Android Studio and Gradle Build Error

Build complete and running but showing error on class android

  1. Remove the lines and re-import them from correct/compatible packages.
  2. Try removing all dependencies then sync and add all dependencies again then sync.

As you mentioned in comments nimi0112 and Ali Ahmed's your answer is really helped me a lot.

Gradle build error: Failed to resolve:

From the SDK manager, make sure you have both the Android Support Repository and Google Repository installed and up to date. You should then be able to find the relevant artifacts in sub folders of your /extras/android/m2repository directory

Gradle build error in Android Studio 3.1.3.2

The default gradle install is part of Android Studio sdk so if you moved your Android Studio files location or have the wrong PATH defined in your environment it won't find the sdk location like this. If your path is to a different android studio installation version it might not have that particular version of gradle in it.

Android Studio and Gradle build error

If you are using the Gradle Wrapper (the recommended option in Android Studio), you enable stacktrace by running gradlew compileDebug --stacktrace from the command line in the root folder of your project (where the gradlew file is).

If you are not using the gradle wrapper, you use gradle compileDebug --stacktrace instead (presumably).

You don't really need to run with --stacktrace though, running gradlew compileDebug by itself, from the command line, should tell you where the error is.

I based this information on this comment:

Android Studio new project can not run, throwing error



Related Topics



Leave a reply



Submit