Error When building a large Codename One Application During the Dex Phase

丶灬走出姿态 提交于 2019-12-10 02:15:53

问题


I got an error in the build server when sending an Android build during the dex phase.

Googling a bit I learned that there is a hard limit of 64K functions (including all libs, the heaviest is google play services), or you can use the multiple dex mechanism.

How do I activate this for Codename One?

I understand Codename One uses Ant and as far as I understand this only works for gradle.

FYI this is the workaround, that splits google play services into sub libraries with native android:

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


回答1:


I had a very similar issue and corresponded with Codename One's pro support on this. Gradle support was something they just recently announced so its not as documented but should be available in the next update.

You need to add the following build hints to your project:

android.gradle=true 
android.multidex=true

I understand that gradle will be the default build once 3.3 rolls around so in the future only the multidex option will be needed.




回答2:


You don't have to add Google Play Service Library in your codenameone app, just add android.includeGPlayServices=true to your build hint and it would be included in build server.



来源:https://stackoverflow.com/questions/34260220/error-when-building-a-large-codename-one-application-during-the-dex-phase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!