MOE Binary Size

BINARY SIZE

Setup

  • Real-World-App with about 5800 classes, a Single Page View and the controller loading all required classes. No additional assets.
  • moe-gradle 1.36 running task moeIpaBuild
  • com.mobidevelop.robovm:robovm-gradle-plugin:2.3.1-SNAPSHOT running task createIPA

Results

  • MOE IPA size: 153.6 MB
  • RoboVM IPA size: 21.9 MB

Any suggestions on what could be wrong with the setup?

Hi,

Did you set proguardLevel 'all' in build.gradle?

Best Regards,
Gergely

Dear @kisg,

proguardLevel ‘full’ must renamed to ‘all’

Regards,
Saeed

Thanks @saeed, I was thinking of the internal name (e.g. proguard-full.cfg). Fixed in the original post.

Hi,
I have been trying for two hours to build my app with proguardLevel=all - without success.
Without additional configuration, the binary has a size of 28 MB. However, it crashes because there are missing classes (as expected). With proguard.append.cfg I try to resolve this problem (btw: using settings from the Android app where it works). Example:

-keepclassmembers class com.caucho.** { *; }

But still the dex2oat process crashes. Like this:

dex2oat F 67846 19786496 /Volumes/SSD/Android/moe-final/aosp/art/compiler/oat_writer.cc:649]Unexpected failure to resolve a method: void com.caucho.burlap.client.BurlapProxyFactory.<init>()
dex2oat F 67846 19786496 /Volumes/SSD/Android/moe-final/aosp/art/compiler/oat_writer.cc:655] java.lang.NoClassDefFoundError: com.caucho.burlap.client.BurlapProxyFactory
dex2oat F 67846 19786496 /Volumes/SSD/Android/moe-final/aosp/art/compiler/oat_writer.cc:655] (Throwable with empty stack trace)
NATIVE BACKTRACE:
0   dex2oat                             0x00000000004bac59 _ZN3art7Runtime5AbortEv + 99
1   dex2oat                             0x00000000004e1669 _ZN3art10LogMessageD2Ev + 635
2   dex2oat                             0x00000000003abf73 _ZN3art9OatWriter22InitImageMethodVisitor11VisitMethodEmRKNS_21ClassDataItemIteratorE + 1693
3   dex2oat                             0x00000000003a7984 _ZN3art9OatWriter15VisitDexMethodsEPNS0_16DexMethodVisitorE + 270
4   dex2oat                             0x00000000003a7471 _ZN3art9OatWriter19InitOatCodeDexFilesEm + 179
5   dex2oat                             0x00000000003a63f8 _ZN3art9OatWriterC2ERKNSt3__16vectorIPKNS_7DexFileENS1_9allocatorIS5_EEEEjmiPKNS_14CompilerDriverEPNS_11ImageWriterEPNS_12TimingLoggerEPNS_7SafeMapINS1_12basic_stringIcNS1_11char_traitsIcEENS6_IcEEEESN_NS1_4lessISN_EENS_17TrackingAllocatorINS1_4pairIKSN_SN_EELNS_12AllocatorTagE7EEEEE + 584
6   dex2oat                             0x000000000022beda _ZN3art7Dex2Oat13CreateOatFileEv + 414
7   dex2oat                             0x000000000021ea0d main + 605
8   libdyld.dylib                       0x00007fff93a5d235 start + 1
9   ???                                 0x0000000000000009 0x0 + 9

dex2oat F 67846 19786496 /Volumes/SSD/Android/moe-final/aosp/art/runtime/runtime.cc:464]Runtime aborting...

At this point I have to stop trying, because it is too time consuming. Sorry, I guess, the binary size would be around 30-40MB, if it worked, which would be fine.