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:
Sometimes you only need to eliminate warnings and the error will be disappeared automatically. See below special case:
I had these two dependencies in my module-level build.gradle
file:
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
and Studio had warned (in addition to dex merging problem):
All
com.android.support
libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions27.0.2
,21.0.3
. Examples includecom.android.support:animated-vector-drawable:27.0.2
andcom.android.support:support-v4:21.0.3
So I explicitly determined the version of com.android.support:support-v4
(see here for details) and both problems (the warning and the one related to dex merging) solved:
implementation 'com.android.support:support-v4:27.0.2' // Added this line (according to above warning message)
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
See below comments for other similar situations.