Today downloaded the studio 3.0 beta 2.0 version, after that tried to open an existing project in it and faced some difficulties, most of them I could solve with the help of
Found my answer, for me personally it was using
implementation "com.google.guava:guava:23.0"
Instead of
implementation "com.google.guava:guava:23.0-android"
It is important part:
You need to add this in that module's build.gradle where it's not added like app module.
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
Also you forgot to add repo for plugin:
buildscript {
repositories {
jcenter()
google()
}
}
I had the same errors(SimException
) that you encountered. I had 3 modules in android clean architecture project:
solution
navigate to File/Project Structure...
make sure your modules has the same Source and Target Compatibility (1.8 in this case)
I added a library with the compileOptions Java 1.8
, and In my main project dont.
Fixed adding:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
I was having the same issue. I had recently deleted my .gradle
cache folder, and reinstalled Android Studio and the SDK. Eventually when trying to git bisect
the problem, it went away. I can only speculate as to why this happened, but I suspect that downloading older versions of the build tools and SDK, and building (and presumably caching) versions of our code with those older tools caused it to be built in a way that didn't cause issues.
This points to some sort of bug in the way that the newer (API 26?) build tools are building the source code, and so my recommendation if you're seeing this problem and the other solutions don't work, is to lower your target SDK version to 25 or lower, install the necessary build tools, and try compiling your code with those, before reverting to build tools 26 or higher.