How to use adMob and (google map api)google play service together?

这一生的挚爱 提交于 2019-12-13 04:24:37

问题


I have an app on the market with adMod banner, and now I am trying to add some Google Maps api to my application.

I know how to handle adMobs library or Google Maps api separately. But when I try to run the app with adMob and Google Maps api (Google Play service), it seems they have a collision or something like that. Or google-play-services.jar and GoogleAdMobAdsSdk.jar have the same class name for AdMob. Maybe due to that reason I am getting multiple .dex files.

My error on my console is:

trouble writing output: already prepared [2014-05-18 18:24:40 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode; [2014-05-18 18:24:40 - WorkC 3.0.9 actionBar] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;

I'm afraid it would be bad to my adMob as soon as I update the application version. How can I fix that?


回答1:


Mobile Ads is now a part of Google Play Services, hence a lot of class names are duplicated now. See the migration guide here.



来源:https://stackoverflow.com/questions/23725887/how-to-use-admob-and-google-map-apigoogle-play-service-together

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