Unable to execute dex: Multiple dex files define Lcom/google/android/gms/ads/AdActivity;

浪子不回头ぞ 提交于 2019-12-24 04:37:06

问题


I'm trying to use google play services in my app.

i have referenced the library, google play serves, in both my app and BaseGameUtils and I have Unable to execute dex: Multiple dex files define Lcom/google/android/gms/ads/AdActivity; "

usually what that means is that you have two .jar files that have the same class name. My only problem is I don't know which jar files have the same classes. Also, I do not have google-play-services as a jar in my libs folder nor have i added it as an external jar in the build path menu. So all i have are two dependencies google-play-servies, and BaseGameUtils, which also uses google-play-servies as a library. So can someone tell me what this issue even means, cause i've tried everything..

here's my research to show i've tried to help myself..

Can´t use adMob api since I updated to API 19

Android Build fail - java.lang.IllegalArgumentException: already added: Lcom/google/api/client/escape/CharEscapers;

"Conversion to Dalvik format failed with error 1" on external JAR

adMob.jar library and google play service.jar not working together


回答1:


So all i have are two dependencies google-play-servies, and BaseGameUtils, which also uses google-play-servies as a library

Are you saying that you are referencing Google Play Services in both BaseGameUtils and your project ?

In BaseGameUtils reference Google Play Services.

In your project reference BaseGameUtils.

Then check to ensure you have got your advertising set up correctly (admobs is now in google play services , no longer a separate jar):

Multiple dex files define - Deleting extra jar file still not working. What should I do?



来源:https://stackoverflow.com/questions/24718671/unable-to-execute-dex-multiple-dex-files-define-lcom-google-android-gms-ads-ada

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!