Following is the build.gradle code in Android Studio
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.sg.blahblah"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
lintOptions {
checkReleaseBuilds true
abortOnError false
xmlReport true
htmlReport true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
lintOptions {
disable 'MissingTranslation'
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.google.android.apps.dashclock:dashclock-api:+'
compile 'com.roughike:bottom-bar:1.4.0.1'
compile 'com.diogobernardino:williamchart:2.2'
}
I am getting the below error: Error:A problem occurred configuring project ':app'.
Failed to notify project evaluation listener. com.android.build.gradle.tasks.factory.AndroidJavaCompile.setDependencyCacheDir(Ljava/io/File;)V
Can anyone please help?
I have met the similar problem.
According to the log above,the most important information is:
Most of the building problems of Gradle will be solved because when you use the specific Gradle build command,you can get more detailed and useful information that are clear.
And then I found the problem is related with the version of Gradle,when I have changed Gradle from 5.0 to 4.1,and then it's OK.
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 got this problem too. I fix it by Change
build.gradle
in projectChange
And also I change the
distributionUrl
in gradle-wrapper.properties(Global Version)And got succeed.FYI.
In my case I solved this error only by Invalidating caches.
File > Invalidate caches / Restart
I had this issue because I was using Charles proxy on my computer and the SSL was enabled for all hosts. And since AS didn't trust my proxy, the network request failed. So I had to disable SSL for all hosts and restart my Android Studio.
With the new google support gradle plugin (
com.google.gms.google-services
) this can be caused by some dependency version problems with yourcom.google.android.gms.*
modules.You can probably see the root cause by running the build command with the
--stacktrace
parameter. i.e.:which might output the cause of the problem: