【问题标题】:MobileFirst Platform 7.1 Android Dex Loader Unable to execute dex: method ID not in [duplicate]MobileFirst Platform 7.1 Android Dex Loader 无法执行 dex:方法 ID 不在 [重复]
【发布时间】:2015-11-19 19:47:20
【问题描述】:

我们正在使用 MobileFirst Platform 7.1 来构建我们的 Android 应用程序。一旦我们将 google play services lib 导入到项目中并尝试构建它,就会出现这样的错误。

[2015-11-19 14:34:46 - Dex Loader] 无法执行 dex:方法 ID 不在 [0, 0xffff] 中:65536 [2015-11-19 14:34:46 - TestWL7] 转换为 Dalvik 格式失败:无法执行 dex:方法 ID 不在 [0, 0xffff] 中:65536

对此有什么想法吗?

【问题讨论】:

    标签: ibm-mobilefirst dex


    【解决方案1】:

    您添加 Google Play 服务库有什么原因吗? 添加 Google Play 服务会增加超过允许的 65K 的方法数量。

    使用 Proguard 来混淆/多索引/仅加载所需的库应该有助于解决此问题。

    更多细节在这里:

    a)Building Apps with Over 65K Methods

    b)Sky’s the limit? No, 65K methods is

    c)Google Play services and DEX method limits

    如果您为推送通知配置播放服务,请注意 MFP 开箱即用,支持推送。即使没有 Google-Play 服务,它也可以工作。添加 Google-Play-services 库是可选步骤。

    如果推送通知支持是添加 Play 服务的唯一原因,那么您可以选择将其从引用中删除。

    【讨论】:

    • 非常感谢您的提示。基本上我们遵循 ibm 知识中心指南:link 我们还尝试使用 proguard 方法来限制它。似乎仍然有同样的问题。
    • 好的,这是有道理的,但 proguard 仅在发布模式下可用。所以如果在开发层面,还是有这种问题,MFP 还不支持 Gradle。您还有其他示例或建议吗?太感谢了
    • 有一个 iFix 解决方案是使用 android studio 和 MFP studio 混合。请查看 ibm 网站。
    猜你喜欢
    • 2014-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-19
    相关资源
    最近更新 更多