cocos2d-x 3.9 android-studio google ad和 google pay 冲突问题解决

前端之家收集整理的这篇文章主要介绍了cocos2d-x 3.9 android-studio google ad和 google pay 冲突问题解决前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
processing classes.dex...
processing archive /Users/dave/projects/games/Thirty/frameworks/runtime-src/proj.android-studio/app/build/intermediates/pre-dexed/debug/support-v4-18.0.0-006c6ec23957b4fba1fbed8b6f0d907ac6203dfb.jar...
ignored resource Meta-INF/MANIFEST.MF
processing classes.dex...
Merged dex A (50 defs/23.7KiB) with dex B (6 defs/1.6KiB). Result is 56 defs/28.0KiB. Took 0.1s
Merged dex A (56 defs/28.0KiB) with dex B (25 defs/3.5KiB). Result is 81 defs/36.2KiB. Took 0.0s
Merged dex A (81 defs/36.2KiB) with dex B (6 defs/6.3KiB). Result is 87 defs/51.6KiB. Took 0.0s
Merged dex A (87 defs/51.6KiB) with dex B (15 defs/26.9KiB). Result is 102 defs/100.3KiB. Took 0.0s
Merged dex A (102 defs/100.3KiB) with dex B (32 defs/32.4KiB). Result is 134 defs/179.8KiB. Took 0.0s
Merged dex A (134 defs/179.8KiB) with dex B (42 defs/47.5KiB). Result is 176 defs/323.7KiB. Took 0.0s
Merged dex A (176 defs/323.7KiB) with dex B (80 defs/64.6KiB). Result is 256 defs/579.6KiB. Took 0.0s
Merged dex A (256 defs/579.6KiB) with dex B (44 defs/53.8KiB). Result is 300 defs/1011.5KiB. Took 0.1s
Result compacted from 1810.9KiB to 292.0KiB to save 1518.9KiB
Merged dex A (300 defs/1011.5KiB) with dex B (38 defs/59.4KiB). Result is 338 defs/292.0KiB. Took 0.1s
Merged dex A (338 defs/292.0KiB) with dex B (73 defs/100.8KiB). Result is 411 defs/476.9KiB. Took 0.0s
Merged dex A (411 defs/476.9KiB) with dex B (62 defs/105.3KiB). Result is 473 defs/740.7KiB. Took 0.0s
Merged dex A (473 defs/740.7KiB) with dex B (123 defs/131.5KiB). Result is 596 defs/1169.8KiB. Took 0.1s
Result compacted from 1964.0KiB to 808.5KiB to save 1155.5KiB
Merged dex A (596 defs/1169.8KiB) with dex B (272 defs/223.3KiB). Result is 868 defs/808.5KiB. Took 0.1s
Merged dex A (868 defs/808.5KiB) with dex B (715 defs/547.9KiB). Result is 1583 defs/1642.7KiB. Took 0.1s
Merged dex A (1583 defs/1642.7KiB) with dex B (647 defs/554.9KiB). Result is 2230 defs/2796.2KiB. Took 0.1s
Result compacted from 4681.5KiB to 2609.5KiB to save 2072.0KiB
Merged dex A (2230 defs/2796.2KiB) with dex B (807 defs/766.8KiB). Result is 3037 defs/2609.5KiB. Took 0.2s
Merged dex A (3037 defs/2609.5KiB) with dex B (620 defs/802.9KiB). Result is 3657 defs/4121.8KiB. Took 0.1s
Result compacted from 6467.7KiB to 4326.9KiB to save 2140.8KiB
Merged dex A (3657 defs/4121.8KiB) with dex B (894 defs/1027.3KiB). Result is 4551 defs/4326.9KiB. Took 0.2s

Unknown source file : UNEXPECTED TOP-LEVEL EXCEPTION:
Unknown source file : com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
Unknown source file :   at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
Unknown source file :   at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
Unknown source file :   at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
Unknown source file :   at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
Unknown source file :   at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
Unknown source file :   at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
Unknown source file :   at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
Unknown source file :   at com.android.dx.command.dexer.Main.run(Main.java:246)
Unknown source file :   at com.android.dx.command.dexer.Main.main(Main.java:215)
Unknown source file :   at com.android.dx.command.Main.main(Main.java:106)

:Thirty:dexDebug Failed
:Thirty:dexDebug (Thread[Task worker Thread 3,5,main]) completed. Took 2.215 secs.

FAILURE: Build Failed with an exception.

* What went wrong:
Execution Failed for task ':Thirty:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

错误是由于工程的support-annotations 的jar文件和 google service-ads里的support-v4的jar 文件冲突所有,需要 exclude 其中一个 。
可以在加入google service-ads jar的时候排除掉

compile ('com.google.android.gms:play-services-ads:8.1.0'){
        exclude module:'support-v4'

    }

禁止转载!!!

猜你在找的Cocos2d-x相关文章