MOE 1.9.0 released

Happy new year and hope you enjoy this release with lots of exciting updates!

This release brings support of lots of Java 8+ APIs!

Breaking changes

  • Need to refresh the xcode project settings through Inject/Refresh Xcode Project Settings option in Android Studio/Intellij, or with the moeUpdateXcodeSettings gradle task.
  • Changes to the return type of the new_objc() & allocWithZone() methods could lead to incompatibility issue with user binding classes. You may need to regenerate bind classes.
  • Name of some of the gradle tasks have been updated

Changelog

SDK changes

  • Add lots of frequently used Java 8+ APIs, including (but not limited to):
    • java.util.stream
    • java.util.function
    • java.time
    • java.nio.file
    • Recent additions to java.util.{Map,Collection,Comparator}
    • Optionals
  • Add org.moe.MOE.Build class with following constants:
    • boolean DEBUG: whether the app is built with debug mode
    • String PLATFORM_NAME: the app platform, “iphoneos” or “iphonesimulator”
    • boolean IS_SIMULATOR: whether it’s running in simulator
  • Updated API binding to iOS 15.3 SDK
  • Deprecated iOS APIs are marked properly
  • Locale.getDefault() now returns the same value as NSLocale.currentLocale()

Gradle plugin changes

  • Remove retrolambda
  • Allow disable proguard shrinking
  • Allow enable proguard obfuscation
  • Allow excluding files & classes completely
  • Allow specifying different proguard configurations for debug & release mode
  • Allow specifying build arch when launching app
  • Improve app shrinking config so less manual configuration is needed when enable shrinking
  • More improvements and bug fixes

Install / Upgrade

Simply change you build script to use the new plugin and SDK:

buildscript {
    dependencies {
        classpath group: 'org.multi-os-engine', name: 'moe-gradle', version: '1.9.0'
    } 
}
8 Likes

Dear @Noisyfox,

this is a very nice release, thank you!

Great features, great progress overall!

Kind regards,
Gergely

1 Like

Hi @Noisyfox!

Thank you very much for this release!

I updated project and bindings but I am getting next error when trying to run the app:
“Cannot run Project.afterEvaluate(Action) when the project is already evaluated”.

Could you share the project with me? Or could you reproduce this issue in a new project?

I did update to the latest XCode 13.3 and do face some issues. Does anyone know how to disable proguard shrinking?
Update: it’s not the proGuard part, it seems to be something different, so i’ll copy the log entries from Build process and push them on pastebin.
But does anyone face similar issues with the latest XCode?error.xcode13_3.moe_log.txt (25.7 KB)

The libgdx must be update to be able to use with moe 1.9 unfortunately.

But is MOE supported in the newer versions?
Or did someone clone the libgdx and impemented the MOE backend?

I did a libgdx fork with a MOE 1.9 backend. But you currently need to build it from source.

1 Like

i did follow the discussion on libgdx issues (https://github.com/libgdx/libgdx/pull/6593) and I 'm grateful for your efforts.

Hello @Berstanio, when you write build from source, do you also mean i have to build the natives too?
Because, did download your project, tried to call gradle natives and the i get an error.
Do i have to create the natives my own?
What prerequisites are necessary for this?

I will update the docs someday, but for now this should be the procedure @yarnee :

  1. Clone https://github.com/Berstanio/libgdx/tree/metal-1.9
  2. Run “./gradlew fetchNatives” (Not 100% sure whether you need that)
  3. Run “./gradlew publishToMavenLocal”

You may need also some adjusting in your libGDX project. Here you can see what it should be: https://github.com/Berstanio/chigginblazzder/tree/moe

As a note, it is probably better to not delete the “custom.xconfig” file. Just keep the generation, but let “-Wl,-all_load” be the only “LIBGDX_NATIVES” content.
Also you should fix the build.gradle copying first, after that you can easily add the xcframeworks to XCode.

1 Like

Hello @Berstanio, i realized the nightlies changed and found something in nexus, so i ll give it a try and come back to you soon. The only thing i do worry about is that your libgdx “…branch is 39 commits ahead, 217 commits behind libgdx/libgdx:master.” But it will be fine, as long i do need to be able to compile my ios stuff !

No, only the pr branch is this way behind. I will update it in a while. But until then, please use this branch instead, it is the working one: https://github.com/Berstanio/libgdx/tree/metal-1.9
@yarnee

Btw. and you can just hit me up on the MOE Discord if you have any questions/problems.

1 Like

I got the same error.
You can reproduce it using the Calculator example, upgrading gradle to 7.x and than run it with XCode. @Noisyfox

@Noisyfox @Andrii_Meretskyi @Berstanio were you able to resolve “Cannot run Project.afterEvaluate(Action) when the project is already evaluated” with MOE 1.9.0? Any clues?

I’m running it on Java 8 and Gradle 7.0.2:

org.gradle.api.InvalidUserCodeException: Cannot run Project.afterEvaluate(Action) when the project is already evaluated.
	at org.gradle.api.internal.project.DefaultProject.failAfterProjectIsEvaluated(DefaultProject.java:1043)
	at org.gradle.api.internal.project.DefaultProject.afterEvaluate(DefaultProject.java:1024)
	at org.moe.gradle.tasks.ResourcePackager.create(ResourcePackager.java:105)
	at org.moe.gradle.tasks.ResourcePackager.lambda$addRule$0(ResourcePackager.java:73)
	at org.moe.gradle.tasks.AbstractBaseTask$2.doCall(AbstractBaseTask.java:272)
	at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  ...