Error: DexArchiveMergerException: Unable to merge dex
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
environment:
android studio 3.0 build 4408382
solution:
test 1: From the
--> result: failed. not work.
task 2: restart a.s.
Error:Please use JDK 8 or newer.
Use embedded JDK (recommended)
Download JDK 8
Select a JDK from the File System
test 2: reset- jdk location and Delete the
--> result: failed. not work.
task3:
add setting in my Android Manifest.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
environment:
android studio 3.0 build 4408382
solution:
test 1: From the
Build
menu, press the Clean Project
button.--> result: failed. not work.
task 2: restart a.s.
Error:Please use JDK 8 or newer.
Use embedded JDK (recommended)
Download JDK 8
Select a JDK from the File System
test 2: reset- jdk location and Delete the
./gradle
folder inside your project--> result: failed. not work.
task3:
add setting in my Android Manifest.
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
...
result:
error:still fail.
error: cannot find symbol class GoogleApiAvailability
the code still error:
public boolean isGooglePlayServicesAvailable(Activity activity) {
GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
int status = googleApiAvailability.isGooglePlayServicesAvailable(activity);
if(status != ConnectionResult.SUCCESS) {
if(googleApiAvailability.isUserResolvableError(status)) {
googleApiAvailability.getErrorDialog(activity, status, 2404).show();
}
return false;
}
return true;
}
solution:
remove the function and not use it.
ok.... run successful.
my setting:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:design:+'
implementation 'com.google.android.gms:play-services-ads:11.6.0'
implementation 'com.android.support:appcompat-v7:27.0.1'}
ps: i don't want to use total
com.google.android.gms:play-services
because it's so big.
just ads.
留言
張貼留言