How to convert Intel MOE based GDX project to OSS version

I have an existing Libgdx project in IDEA with the old Intel MOE plug-in. I want to use the OSS MOE version. This is what I did:

Removed (uninstall) the Intel MOE
I created a new project following the above instruction (with the new setup jar file)
I looked at the new build.gradle file from the new project and change the dependency packages in my existing project build.gradle file accordingly (including changing from Libgdx 1.93 to 1.9.5-SNAPSHOT).

But I’m getting this error… what should I do?

Error:Unable to make the module: GDXTest, related gradle configuration was not found. Please, re-import the Gradle project and try again.

I somehow managed to get through my previous issue (has something to do with a 3rd party library I use), and now I was able build with no errors.

When running the iOS config I’m getting an error on Xcode project. Could you explain more on how to replace the existing Xcode project with the new one from the new libgdx setup file? Thanks a lot

So I have my own thread :slight_smile:

I copied the whole “xcode” folder from the new project to my project. Changed the package name in Info.plist in the ios-moe folder and managed to make it compile and launched the simulator. But then the app crashed.

I opened up the xcode project in xcode and run, saw this error. Is this a known issue?

Terminating app due to uncaught exception ‘java.lang.UnsatisfiedLinkError’, reason: 'java.lang.UnsatisfiedLinkError: No implementation found for long com.badlogic.gdx.graphics.g2d.freetype.FreeType.initFreeTypeJni() (tried Java_com_badlogic_gdx_graphics_g2d_freetype_FreeType_initFreeTypeJni and Java_com_badlogic_gdx_graphics_g2d_freetype_FreeType_initFreeTypeJni__)

Dear Brian,

the recommended solution is to move over your sources to a newly generated project. If this is not feasible, then you should try to execute the following steps:

  • you need to copy the build.xcconfig from a new MOE 1.1 Xcode project
  • you also need to replace the custom “Compile Sources (MOE)” build script phase in the Xcode project from a new MOE 1.1 project
  • depending on your project layout, you might have to change the MOE_PROJECT_DIR and possibly MOE_PROJECT_BUILD_DIR in your new build.xcconfig to point to the right folder
  • Change Intel.MOE.Main.Class to MOE.Main.Class in Info.plist

Here is a GitHub issue where a similar project conversion was discussed (the lower half of the issue): https://github.com/multi-os-engine/multi-os-engine/issues/44

Best Regards,
Gergely

Thanks Gergely, I followed your advice and moved my source, assets and 3rd party jars (SmartFoxServer client API) into the newly created project. It built and ran but it seems some of the classes in the 3rd party jars are missing.

The error I got is like this, but it may not be too helpful:

sfs2x.client.controllers.SystemController - Cannot instantiate handler for eventId: 0, ResHandshake, Class: sfs2x.client.controllers.system…ResHandshake

My post on the SFS forum:
http://www.smartfoxserver.com/forums/viewtopic.php?f=22&t=18516

The only got some warning in xcode, not sure if they’re relevant…

ld: warning: directory not found for option ‘-L/Users/xxx/LIBGDX195/ios-moe/xcode/…/build/libs/static’
ld: warning: directory not found for option ‘-L/Users/xxx/LIBGDX195/ios-moe/xcode/…/build/libs/static/iphonesimulator’
ld: warning: directory not found for option ‘-F/Users/xxx/LIBGDX195/ios-moe/xcode/…/build/libs/static’
ld: warning: directory not found for option ‘-F/Users/xxx/LIBGDX195/ios-moe/xcode/…/build/libs/static/iphonesimulator’
ld: warning: directory not found for option ‘-F/Users/xxx/LIBGDX195/ios-moe/xcode/…/build/libs/dynamic’
ld: warning: directory not found for option ‘-F/Users/xxx/LIBGDX195/ios-moe/xcode/…/build/libs/dynamic/iphonesimulator’
ld: warning: -pagezero_size not page aligned, rounding down

Dear Brian Chan,

could you please check whether the missing classes can be found in your ProGuard output jar?

build/moe/main/proguard/output.jar

You can do this from command-line with something like this:

jar tvf build/moe/main/proguard/output.jar | grep "MyClass.class"

If they are missing, use ProGuard rules and proguard.append.cfg file to customize ProGuard’s behavior.

ProGuard rules
ProGuard task

1 Like

OMG, it works with your tip! Thank you so much!

The freetype font error is still outstanding though…

'java.lang.UnsatisfiedLinkError: No implementation found for long com.badlogic.gdx.graphics.g2d.freetype.FreeType.initFreeTypeJni() (tried Java_com_badlogic_gdx_graphics_g2d_freetype_FreeType_initFreeTypeJni and Java_com_badlogic_gdx_graphics_g2d_freetype_FreeType_initFreeTypeJni__)
at com.badlogic.gdx.graphics.g2d.freetype.FreeType.initFreeTypeJni(Native Method)
at com.badlogic.gdx.graphics.g2d.freetype.FreeType.initFreeType(FreeType.java:866)
at com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.(FreeTypeFontGenerator.java:94)

Dear Brian Chan,

it looks like libGDX’s FreeType library is not being linked correctly (or at all). I would suggest to create a new libGDX project and in its Xcode project’s build settings, look at how linking is done and in the MOE module’s build.gradle file.

I got it to work, I wrongly put compile instead of native in the grade file :stuck_out_tongue:

And I also upgraded to MOE1.2 and Xcode 8 to work with my iPhone 6 running iOS 10. Great to see my game running on the phone. A big thanks to the MOE and LIBGDX teams!!

Hi, could you elaborate on what you mean about the gradle file? I’m currently having the same font issue.

1 Like

I mean in the build.gradle file in your project, under dependencies I have the following:

dependencies {
    compile project(":core")
    compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
    compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
    compile fileTree(dir: 'lib', include: '*.jar')
}

JFTR, I have the same “No implementation found for long com.badlogic.gdx.graphics.g2d.freetype.FreeType.initFreeTypeJni()” issue but for different reasons: I simply haven’t added freetype dependencies to my ios-moe project. So I just added this two lines:

compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"

In the main project’s build.gradle file, within the ‘dependencies’ section of the project(":ios-moe").

Then, for some other reason the task copyNatives seems not to be executed in my project when I build such module even if something has changed, so I just run it by hand inside a terminal:

$ ./gradlew ios-moe:copyNatives

That was it!

Hi, Brian! Could you please explain what means “OSS” version? Is that just mean more newly version of MOE that is now open-source? Does OSS stand for Open Source Software? Thanks in advance!

This is a very old thread that started in September 2016, when the first open-source (OSS) release of MOE was done.

Intel MOE = The closed-source version of MOE, prior to the open-sourcing.
OSS MOE = The open-sourced version of MOE.

The OSS MOE release included everything that was in the Intel MOE except for the Intel specific installer and support for building on the Intel Mobile Cloud Build service.