2
votes

Gradle sync failed: A problem occurred configuring project ':app'. Consult IDE log for more details.

Hence I'm very new to the Android Studio just tried to setup for the first time. Even I tried all the methods which mentioned for the gradle sync failed unfortunately nothing works. Please help to find the issue.

Classpath:

buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.2'

   // NOTE: Do not place your application dependencies here; they >belong
   // in the individual module build.gradle files

} }

Wrapper Properties :

Wed May 24 08:00:32 IST 2017

distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip

Error while Re-Building :

 Error:A problem occurred configuring project ':app'.
 > java.lang.NullPointerException (no error message)

Thanks in advance

Update : Added Logs

Logs

4
On toolbar -> Help Menu -> Show log in explorer. This link may help stackoverflow.com/questions/19784877/…Rust Fisher
user8118976, is it possible for you to share the error log ?mdb
I have updated the post with logs. Please share your thoughtsSudhakar_ak
@Sudhakar_ak have a solve?Fortran

4 Answers

1
votes

I had the same error with an up-to-date Android Studio (4.1.3) and a recent NDK (22.0.7026061 downloaded via Studio).

First of all, even if your NDK was downloaded through Studio you can/must specify your NDK directory in your local.properties file : ndk.dir=/path/to/ndk

But in my case, having a correct NDK path specified in local.properties wasn't enough, like for you Android Studio (gradle) kept refusing to build. So I ended up manually creating an empty directory "platforms" in the NDK installation folder, then invalidated & restarted Studio. And surprisingly, it seems to resolve the thing.

0
votes

Try Build -> Clean Project andthen try it again

0
votes

Clean the project & try again. If that didn't help too, restart android studio.

0
votes

Follow these three steps:

  1. Check if your project level build.gradle file has this line:
    classpath 'com.android.tools.build:gradle:2.3.2'
  2. Make sure your gradle-wrapper.properties file in gradle folder looks exactly like this:
  3. Delete .gradle folder from your project directory `

    distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip

` 4. Build -> Clean Project 5. File -> Invalidate Caches/Restart 6. Build -> Rebuild Project