每当我尝试构建自己的cordova应用程序时,都会出现此错误:
:mergeArmv7DeBUGAssets UP-TO-DATE
:createXwalkCommandlinefileArmv7DeBUG
:generateArmv7DeBUGResValues UP-TO-DATE
:generateArmv7DeBUGResources UP-TO-DATE
:mergeArmv7DeBUGResources
:processArmv7DeBUGManifest
:processArmv7DeBUGResources
:generateArmv7DeBUGSources
:compileArmv7DeBUGJava
:preDexArmv7DeBUG
:dexArmv7DeBUGUNEXPECTED top-LEVEL EXCEPTION:
com.androID.dex.DexException: Multiple dex files define Lcom/Google/ads/AdRequest$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: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):dexArmv7DeBUG Failed
FAILURE: Build Failed with an exception.
What went wrong:
Execution Failed for task ‘:dexArmv7DeBUG’.
com.androID.IDe.common.internal.LoggedErrorException: Failed to run command:
/Users/sombriks/library/Android/sdk/build-tools/22.0.1/dx –dex –no-optimize –output /Users/sombriks/git/g4l-taxi/platforms/androID/build/intermediates/dex/armv7/deBUG –input-List=/Users/sombriks/git/g4l-taxi/platforms/androID/build/intermediates/tmp/dex/armv7/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.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: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)Try:
Run with –stacktrace option to get the stack trace. Run with –info or –deBUG option to get more log output.BUILD Failed
Total time: 27.511 secs
/Users/sombriks/git/g4l-taxi/platforms/androID/cordova/node_modules/q/q.Js:126
throw e;
^Error code 1 for command: /Users/sombriks/git/g4l-taxi/platforms/androID/gradlew with args: cdvBuildDeBUG,-b,/Users/sombriks/git/g4l-taxi/platforms/androID/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/sombriks/git/g4l-taxi/platforms/androID/cordova/build: Command Failed with exit code 8
You may not have the required environment or OS to build this project
Error: /Users/sombriks/git/g4l-taxi/platforms/androID/cordova/build: Command Failed with exit code 8at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.Js:134:23)
at ChildProcess.emit (events.Js:98:17)at maybeClose (child_process.Js:756:16)
at Process.ChildProcess._handle.onexit (child_process.Js:823:5)
[sombriks@eiko g4l-taxi]$
这是我的插件列表:
[sombriks@eiko g4l-taxi]$cordova plugin List
cordova-plugin-admobpro 2.8.1 “AdMob Plugin Pro”
cordova-plugin-crosswalk-webvIEw 1.2.0 “Crosswalk WebVIEw Engine”
cordova-plugin-extension 1.1.4 “Cordova Plugin Extension”
cordova-plugin-Googleplayservices 19.0.1 “Google Play Services for AndroID”
cordova-plugin-whiteList 1.0.0 “WhiteList”
org.apache.cordova.console 0.2.13 “Console”
只有androID内部版本显示此问题,ios内部版本会编译并运行.
一些other posts建议修改我的build.gradle,但到目前为止没有任何效果.
如果以前有人遇到过此类问题,请提供帮助.
提前致谢.
编辑:
创建一个新项目并仅添加crosswalk plugin给我一个可以正常工作的项目,包括androID和ios.我将添加更多插件,看看会发生什么.
解决方法:
cordova-plugin-Googleplayservices 19.0.1“适用于AndroID的Google Play服务”
删除此插件,它已被弃用,不再需要.
请参阅常见问题3:https://github.com/floatinghotpot/cordova-admob-pro/wiki/Difference-of-Plugin-IDs
总结以上是内存溢出为你收集整理的android平台上的cordova插件冲突全部内容,希望文章能够帮你解决android平台上的cordova插件冲突所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)