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:
This may not be your problem, but I got this error when I accidentally included two identical (but differently named) libraries in the dependencies{} section of the project.
Just to add to the above solutions:
Make sure that you don't have duplicate dependencies pointing to different versions of them, in multiple places (or even in the same file).
I agree with Chris-Jr. If you are using Firebase to embed your AdMob ads (or even if you are not) the play-services-analytics includes the play-services-ads even though you don't add that as a dependency. Google have obviously made a mistake in their 11.4.0 roll-out as the analytics is including version 10.0.1 of ads, not 11.4.0 (the mouse over hint in the gradle shows this).
I manually added compile 'com.google.android.gms:play-services-ads:11.4.0' at the top which worked, but only after I disabled Instant Run: http://stackoverflow.com/a/35169716/530047
So its either regress to 10.0.1 or add the ads and disable Instant Run. That's what I found if it helps any.
Installing Google play services (latest version) + including
android {
defaultConfig {
multiDexEnabled true
}
}
in build.gradle solved the issue for me, make sure to clean and rebuild project!
I tried all the above and none of them helps. finally, I find this work for me:
app/build.gradle:
android {
defaultConfig {
multiDexEnabled true
}
}
With Android Studio 3.0 stable build Below steps worked for me: