我正在尝试在同一个应用中实施 AdMob和Google Analytics 。 事情是它们分开工作,但在同一个应用程序中它们有错误。
对于AdMob,我单独使用,(1)和(2)。
但是,当我尝试使用(1)和(3)或(2)和(3)时,将它们组合在一起就会出现这个错误:
:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/ads/AdReques
t$ErrorCode;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:45
4)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':dexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Program Files (x86)\Android\android-sdk\build-tools\22.0.1\dx.bat --d
ex --no-optimize --output C:\a\0\testAdsGA\platforms\android\build\intermediates
\dex\debug --input-list=C:\a\0\testAdsGA\platforms\android\build\intermediates\t
mp\dex\debug\inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/ads/
AdRequest$ErrorCode;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.ja
va:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:
554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:
535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main
.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
答案 0 :(得分:0)
我是https://github.com/appfeel/admob-google-cordova的admob-google-cordova的作者。
您是否尝试在https://github.com/appfeel/analytics-google使用我们的分析插件?