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?
This is neither an exact answer to the question nor a silver bullet. However, if nothing works for you e.g. Invalidate cache & restart, Checking build dependency, Disabling Instant Run (I never advise that) etc.
--stacktrace
in Setting > Build, Execution, Deployment > CompilerI have misspelled the dependency name in module level gradle file. Hope that help
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
Main gradle-wrapper.properties:
First Step:File → Settings → Build, Execution, Deployment → Instant Run and uncheck Enable Instant Run. Second step: Press Invalidate/Restart. done.... Enjoy.
In my case, I had to do -
File -> Sync Project with Gradle Files
In my case, I was missing the target SDK platform installed. I remember this error was straightforward and prompted you to install it automatically. Worth checking that as well.
had similar problem, issue was different versions of included library. to find out what causes problem run build command with stacktrace