【问题标题】:Error When building a large Codename One Application During the Dex Phase在 Dex 阶段构建大型 Codename One 应用程序时出错
【发布时间】:2016-03-19 12:45:30
【问题描述】:

在 dex 阶段发送 Android 构建时,构建服务器出现错误。

google了一下得知有64K函数的硬性限制(包括所有libs,最重的是google play services),也可以使用multiple dex机制。

如何为代号一激活此功能?

我了解Codename One 使用 Ant,据我所知,这仅适用于 gradle。

仅供参考,这是一种解决方法,将 google play 服务拆分为带有原生 android 的子库:

http://android-developers.blogspot.com.es/2014/12/google-play-services-and-dex-method.html

【问题讨论】:

  • android.multidex=true

标签: android gradle codenameone dex


【解决方案1】:

我遇到了一个非常相似的问题,并与 Codename One 的专业支持人员对此进行了通信。 Gradle support 是他们最近才宣布的,因此它没有记录在案,但应该在下一次更新中可用。

您需要在项目中添加以下构建提示:

android.gradle=true 
android.multidex=true

我知道一旦 3.3 推出,gradle 将成为默认构建,因此将来只需要 multidex 选项。

【讨论】:

    【解决方案2】:

    您不必在您的代号应用中添加 Google Play 服务库,只需将 android.includeGPlayServices=true 添加到您的构建提示中,它就会包含在构建服务器中。

    【讨论】:

    • 哇,好快,马上试试
    • 我了解到最近android.includeGPlayServices 已默认为true。即使您不添加构建提示,它也会在需要的地方使用。要关闭它,请将其设置为 false。
    猜你喜欢
    • 2017-01-12
    • 2017-11-23
    • 1970-01-01
    • 2017-09-24
    • 1970-01-01
    • 2018-08-12
    • 2021-08-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多