【问题标题】:My Cordova project won't compiles after Installing Appodeal Plugins安装 Appodeal 插件后,我的 Cordova 项目无法编译
【发布时间】:2016-06-01 01:52:25
【问题描述】:

我的项目一切正常,但如果我包含这些插件,它将无法编译

com.appodeal.plugin

com.appodeal.googleplayservices

PS:我正在学习本教程第 2 步

这里是我得到的日志

:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

:compileDebugNdk UP-TO-DATE
:compileDebugSources
:transformClassesWithDexForDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
    at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:484)
    at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:261)
    at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:473)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:161)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)


 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

我不了解 Java 和 Cordova 原生配置的详细信息,我只是 Web 开发人员,抱歉

【问题讨论】:

    标签: javascript java cordova


    【解决方案1】:

    我知道现在回复有点晚,但如果有人有同样的问题,这里是解决方案:

    cordova plugin add https://github.com/jwall149/cordova-multidex
    

    或者你也可以直接将cordova插件添加到package.json中

    {
      "locator": "https://github.com/jwall149/cordova-multidex",
      "id": "cordova-multidex"
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-25
      • 2023-03-08
      • 2023-03-09
      • 1970-01-01
      • 2015-01-07
      • 2020-03-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多