Following is the build.gradle code in Android Studio
apply plugin: \'com.android.application\'
android {
compileSdkVersion 23
buildToolsVersion \"23
For me, this issue arose due to an incompatible combination of plugin and gradle.
I added these to the code to have it working:
Main build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
Main gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
Just Change the Distribution url at gradle-wrapper.properties
Place it : https://services.gradle.org/distributions/gradle-4.10.1-all.zip
I got this problem too. I fix it by Change build.gradle
in project
Change
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
And also I change the distributionUrl
in gradle-wrapper.properties(Global Version)
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip
And got succeed.FYI.
It is interesting but as for me help this:
File -> Setting -> Gradle -> disable offline work
SETTINGS -> Build, Execution, Deployment -> Gradle -> unselect Offline work Then sync project, you are good to go. If not working , then File > Invalidate caches / Restart - > Invalidate and Restart.
I enabled "Offline-Work" under File -> Settings ->Build,Deploy, Exec -> Gradle And this finally resolved the issue for me.