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

2

11

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

Filling answered 14/12, 2015 at 5:17 Comment(1)
android.multidex=trueMacario
E
8

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.

Emboly answered 14/12, 2015 at 5:26 Comment(0)
B
6

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.

Buoyancy answered 14/12, 2015 at 5:26 Comment(2)
Wow that was fast, trying it nowFilling
I learnt that recently android.includeGPlayServices has been default to true. Even if you don't add the build hint, it would be used where needed. To turn it off, set it to false.Buoyancy

© 2022 - 2024 — McMap. All rights reserved.