I have Android Studio Beta. I created a new project with compile my old modules but when I tried launching the app it did not launch with the message:
Error:
In my case issue was because of the room library:
compile 'android.arch.persistence.room:runtime:1.0.0-alpha1'
Changing it to:
compile 'android.arch.persistence.room:runtime:1.0.0'
worked.
add commands below:
android {
...
dexOptions {
jumboMode true
javaMaxHeapSize "4g"
}
}
One of possible root causes: duplicate transient dependencies that weren't properly handled by Android Studio import of multi-module projects. Check your list and remove them. For me, the fix was literally this:
--- a/project/module/build.gradle
+++ b/project/module/build.gradle
@@ -21,5 +21,4 @@ android {
dependencies {
implementation project(':upstream-dependency-project')
implementation 'com.android.support:support-v4:18.0.0'
- implementation files('libs/slf4j-android-1.6.1-RC1.jar')
}
android {
defaultConfig {
...
minSdkVersion 15
targetSdkVersion 26
multiDexEnabled true
}
...
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
If this error appeared for you after including kotlin support, and none of the other solutions work, try changing the kotlin dependency of app module's build.gradle
to:
implementation ("org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version") {
exclude group: 'org.jetbrains', module: 'annotations'
}
This works for me on Android Studio 3.0 Beta 6. See this answer for further explanation.
I also had the problem.
I was able to solve by changing compileSdkVersion
and targetSdkVersion
to latest version.