I’m happy to announce that the first alpha of MOE 2.0.0 has been released.
Changes
This release switches the backing technology from ART (Android Runtime) to GraalVM’s Native Image.
native-image allows for using the newest java features (currently JDK 21), has better runtime performance and fixes multiple issues with MOE 1.x.
Furthermore, r8 has replaced proguard as the shrinker.
native-image can be configured in gradle:
moe.nativeImage.options = [...] // List of commandLine parameters for native-image
moe.resources.autodetection {} // allows for automatic configuration of resources
Known limitations
- native-image operates on the closed world assumption. Reflection and similar might not work out of box, see here for more details: Dynamic Features of Java
- JDWP based debugging is not supported ([GR-42742] JDWP-based Debugging Support · Issue #5648 · oracle/graal · GitHub, Planned Upgrades to Debug Info Support · Issue #5047 · oracle/graal · GitHub)
- Build time is heavily increased. This will improve this: [GR-48103] Native Image Layers · Issue #7626 · oracle/graal · GitHub
How to upgrade
Simply change your build script to use the new plugin and SDK:
buildscript {
dependencies {
classpath group: 'org.multi-os-engine', name: 'moe-gradle', version: ‘2.0.0-alpha1’
}
}
Then, don’t forget to refresh the xcode project settings through Inject/Refresh Xcode Project Settings option in Android Studio/Intellij, or with the moeUpdateXcodeSettings
gradle task.
The gradle plugin will automatically fetch a compatible graalVM JVM. Alternativly, you can specifiy a compatible (JDK 21) one with the moe.graalvm.home
property.
What to expect
This is an alpha release, so do expect issues.
Specifically reflection use in your code base will lead to trouble and need to be configured properly. See the native-image docs for more info. MOE reflection should be automatically handled.
If you face migration issues related to MOE, kindly report them back.
Future
As all the blocking graalVM tickets are aimed to be solved with the JDK 25 release in september, this is what I’m aiming for for a stable MOE 2.0.0 release.