1

I am trying to import an android project to Android studio,after importing and then clicking on the green run button :

FAILURE: Build failed with an exception.
  • Where:

Build file '/home/myusername/prjcts/nomadx/settings.gradle' line: 1

  • What went wrong: A problem occurred evaluating root project 'nomadx'.

Could not find method include() for arguments [:app] on root project 'nomadx'.

The content of the file settings.gradle

include ':app'
Mohamed ALOUANE
  • 5,349
  • 6
  • 29
  • 60

2 Answers2

2

I solved the problem ; for those who have the same issue : You should build the gradle with the Terminal/console not with Android studio :

./gradlew assembleRelease
Mohamed ALOUANE
  • 5,349
  • 6
  • 29
  • 60
0

After getting this error on first setup: capacitor.settings.gradle' as it does not exist

..I used two commands from that page: npx cap sync android and npm install --save @capacitor/core @capacitor/cli. I'm not sure which one fixed that error, but it gave me the one on this page. I didnt want to build Gradle again when Android Studio should have it, so I restarted it and it started downloading a bunch of Gradle stuff to: /home/user/.gradle. It then prompted me to upgrade Gradle.

I then got a similar error to the OP Could not find method include() for arguments [:app] on root project 'android' of type org.gradle.api.Project..

So finally running the above ./gradlew assembleRelease, this error was shown: To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager. All licenses can be accepted using the sdkmanager command line tool: sdkmanager.bat --licenses

I installed SDK sudo snap install android-sdk but didnt have it. Installed with sudo apt install sdkmanager and then sudo sdkmanager --licences (y) to accept.. and got the same error. Found sdkmanager under Tools in AStudio. Tried to update there, but failed. Opened with sudo android-studio, had to select /home/user/.config/Google/AndroidStudioX.Y

alchemy
  • 954
  • 10
  • 17