2

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

Sudhakar_ak
  • 21
  • 1
  • 4

4 Answers4

1

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

Try Build -> Clean Project andthen try it again

Jonas1902
  • 93
  • 1
  • 10
  • Tried, Still the same error persists. Build and rebuild doesn't give any effect. I can't see anything run after I click Build and Rebuild. – Sudhakar_ak Jun 07 '17 at 05:16
0

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

vss
  • 1,093
  • 1
  • 20
  • 33
0

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

Sneh Pandya
  • 8,197
  • 7
  • 35
  • 50