Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Executing Gradle tasks as part of an undefined build is not supported #5229

Closed
jmadelaine opened this issue Nov 10, 2021 · 1 comment · Fixed by #5233
Closed

bug: Executing Gradle tasks as part of an undefined build is not supported #5229

jmadelaine opened this issue Nov 10, 2021 · 1 comment · Fixed by #5233

Comments

@jmadelaine
Copy link

Bug Report

Capacitor Version

[warn] The hideLogs configuration option has been deprecated. Please update to use loggingBehavior instead.
💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 3.3.1
  @capacitor/core: 3.3.1
  @capacitor/android: 3.3.1
  @capacitor/ios: 3.3.1

Installed Dependencies:

  @capacitor/cli: 3.3.1
  @capacitor/android: 3.3.1
  @capacitor/core: 3.3.1
  @capacitor/ios: 3.3.1

[success] Android looking great! 👌

Platform(s)

Android

Reproduce

Steps to reproduce:

  • Create a React app: npx create-react-app my-app
  • Install cap core and cli: npm install @capacitor/core @capacitor/cli
  • Initialize repo: npx cap init
  • Install Android support: npm install @capacitor/android
  • Add Android to project: npx cap add android

Expected Behavior

Android is added successfully

Actual Behavior

[warn] The hideLogs configuration option has been deprecated. Please update to use loggingBehavior instead.
✔ Adding native android project in android in 34.15ms
⠇ add Error running gradle sync 
FAILURE: Build failed with an exception.

* What went wrong:
Executing Gradle tasks as part of an undefined build is not supported. Make sure that you are executing Gradle from a folder within your Gradle project. Your project should have a 'settings.gradle(.kts)' file in the root folder.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 534ms

Unable to infer default Android SDK settings. This is fine, just run npx cap open android and import and sync gradle manually
✔ Syncing Gradle in 1.45s
✔ add in 1.48s
✔ Copying web assets from build to android/app/src/main/assets/public in 60.16ms
✔ Creating capacitor.config.json in android/app/src/main/assets in 486.84μp
✔ copy android in 87.74ms
✔ Updating Android plugins in 8.37ms
[info] Found 1 Capacitor plugin for android:
       @capacitor/app@1.0.6
✔ update android in 42.26ms
[success] android platform added!
Follow the Developer Workflow guide to get building:
https://capacitorjs.com/docs/basics/workflow

Other Technical Details

npm --version output: 8.1.0

node --version output: 16.13.0

Additional Context

Why does Gradle fail while building for Android? Any help please guys?

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 10, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants