Following is the build.gradle code in Android Studio
apply plugin: \'com.android.application\'
android {
compileSdkVersion 23
buildToolsVersion \"23
In my case I solved this error only by Invalidating caches.
File > Invalidate caches / Restart
For those of you working on a team:
I pulled down some changes that included updating the build tools version, but I had not downloaded that new version of the build tools on my machine. Downloading the new version fixed this issue for me
I ignored using JDK13 with Android Studio, So I selected below settings and it was solved:
Step 1. (File > Other Settings > Default Project Structure > SDK Location > JDK Location)
Embedded JDK
Step 2. (File > Project Structure > Project)
gradle plugin 3.6.3
gradle 5.6.4
Usually it depends on Instant run or Gradle, but I tried both variants and nothing helped me. Then I looked through idea.log
and saw this error
Caused by: java.lang.RuntimeException: A conflict was found between the
following modules:
- com.android.support:support-core-utils:25.3.1
- com.android.support:support-core-utils:27.0.1
I really don't know why this error is not shown in Gradle Console
or Event Log
tab. Then I fixed it by adding some code to the end of android{}
block.
configurations.all {
resolutionStrategy {
failOnVersionConflict()
eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'support-core-utils') {
details.useVersion '25.3.1'//Or you can use 27.0.1 if it does not conflict with your other dependencies
}
}
}
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 > CompilerCaused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.squareup.okhttp3:logging-interceptor:3.9.1Net.
I have misspelled the dependency name in module level gradle file. Hope that help
In my case I had to update all the Firebase libraries to the latest versions.