icerockdev / moko-resources

Resources access for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev/
Apache License 2.0
1.08k stars 120 forks source link

Exception in kotlin/compose multiplatorm preview #632

Open mndsl opened 8 months ago

mndsl commented 8 months ago

Preview failed with exception: org.objectweb.asm.MethodTooLargeException: Method too large: com/example/shared/MR$strings. ()V

The strings.xml contains about 2000 lines (texts). I've tried to split to different files, however, the generated file merges all strings from all files. Note that the build is successful and the app runs fine, just the preview is crashing. I'm not sure if this is Android Studio/Java issue, but obviously the generated MR class is far too large. It will be good if we can split somehow large files, not just putting everything in one huge class.

lppedd commented 7 months ago

This is a JVM limitation in general, 65535 bytes per method.

moko-resources should split up the method at a certain size.