LibGDX & MOE 'application Did Finish Launching With Options'

Hello guys,

I used LibGDX 1.9.10 and MOE 1.7.4 to create my IOS app.
I use Xcode to and test it on my IOS device. Actually everything were fine - it work properly on
device .

But when i tried to install some Admob / Firebase SDK inside ‘applicationDidFinishLaunchingWithOptions’ -> problem up:

It said : ‘applicationDidFinishLaunchingWithOptions(UIApplication, NSDictionary<?, ?>)’ in ‘’ clashes with ‘applicationDidFinishLaunchingWithOptions(UIApplication, NSDictionary<String, ?>)’ in ‘apple.uikit.protocol.UIApplicationDelegate’; both methods have same erasure, yet neither overrides the other

Here my

public class IOSMoeLauncher extends IOSApplication.Delegate {
protected IOSMoeLauncher(Pointer peer) {
IOSApplication application;
MyGame game;
protected IOSApplication createApplication() {
    IOSApplicationConfiguration config = new IOSApplicationConfiguration();
    config.useAccelerometer = false;

    game = new MyGame();
    application =  new IOSApplication(game, config);

    return application;

public static void main(String[] argv) {
    UIKit.UIApplicationMain(0, null, null, IOSMoeLauncher.class.getName());

public void applicationDidBecomeActive(UIApplication application) {
    //"TEST", "applicationDidBecomeActive");

public boolean applicationDidFinishLaunchingWithOptions(UIApplication application, NSDictionary<?, ?> launchOptions) {
    // I want to install some sdk here
    return super.applicationDidFinishLaunchingWithOptions(application, launchOptions);

public void applicationDidFinishLaunching(UIApplication application) {
    //"TEST", "applicationDidFinishLaunching");


Any solutions for this one?? I look forward and appreciate your help!!


The problem here is that the MOE version the libgdx backend was build for doesn’t match the MOE version you are using. The parameters of " applicationDidFinishLaunchingWithOptions" changed from NSDictionary<?, ?> to NSDictionary<String, ?> in this commit:
So there are three options I think:

  1. Use an older MOE version.
  2. Don’t use IOSApplication.Delegate. A option how you could do it can be found here:
  3. Build LibGDX from source with an updated MOE backend. (I have a repo for this but it is currently just for MOE 2.0. But it can be easily adjusted to MOE 1.x. Just some file deletion I think). With this you could also have LibGDX use Metal instead of the deprecated OpenGLES. If this would be the way you want to go I could give you further informations.
1 Like

Ohh hey @Berstanio!! Thank for your help :+1:

Actually I already fixed my code. I have checked and followed the instructions from this post:

  1. So I did change my
  2. Created a new AppViewCotroller
  3. Created a new Main.Storyboard and link the View

It took me a little time to reseach and adjust to the above changes :grinning: Now i can run my app on IOS Devices and I also added some SDK from GoogleAdmob and Firebase.

But due to my lack of experience with handling these above, so my app has new probs :joy: :joy:

  1. Config the View to make it Fullscreen on all IOS devices.
  2. Try to freeze my orientation. My app is landscape but after show an Interstitial or VideoReward -> It became Potrait?? Please check my demo images:

Right Orientation.

Orientation changed after see ads :))

I will try to fix these above and also try your methods. Hope that i wont have more probs !!

Thank you!!

Hi @Berstanio!! Hope you have a nice day :+1:

I fixed my app by following your suggestion :grinning:

So here what i changed:

  1. Changed everything inside the IOSMoeLancher . Instead of IOSApplication.Delegate -> I used UIApplicationDelegate.
  2. Create a new class MyIOSApplication extends IOSApplication.
  3. Remove the Main.storyboard & AppViewController . Now i created my app inside the applicationDidFinishLaunchingWithOptions .
  4. Use Metal instead of OpenGLES.
  5. My app have proguard , so i added this: -keep class apple.uikit.protocol.UIApplicationDelegate { *; } inside my proguard.

With the above changes, now i can run and test my app on my IOS devices.
Remove the storyboard and view -> so bye bye 2 probs in my last repiled :joy: :joy:
Now i need to add some Firebase Crashlystic and RemoteConfig to test and track my app before release it to the app store :laughing:

Once again, thank for your help!! It has saved me more time instead of having to research by myself.


Ah thats great to hear!

About the 2. point. Here I forgot to mention something about the sample I gave you ( ). The sample was updated to support MOE 2.0. In order to do that I needed to replace the old LibGDX MOE Logger with a updated one because the old Logger relied on some art libraries. So creating the MyIOSApplication class should be only needed for MOE 2.0, not for MOE 1.x which you are using. Therefor I think you could delete this class and use the standard “IOSApplication”.

Just curios about the 4. point. How did you switched to Metal? Have you found my repository?

Okay thanks for your info!

  • I had fix my app. So i deleted MyIOSApplication class.
  • Yeah when i used Xcode to build a demo on my IOS device. It said OpenGLES was deprecated , and use Metal instead. So I just followed that.

About the second point: The switching from OpenGLES to Metal needs to be done in LibGDX. Have a look here: This is the file that creates the OpenGL calls for LibGDX and as you see it imports the OpenGLES header. And switching from OpenGLES to Metal is sadly not easy for LibGDX.
But there is a project called “MetalANGLE” which creates from OpenGL calls Metal calls. I implemented this in a fork of LibGDX and if you want to test/use this, this would be the steps:

  1. change the libGDX Version to 1.10.1-SNAPSHOT
  2. add this maven repository with “maven { url ‘’ }”
  3. Change the artifacts:
  4. Replace this line
if ("natives-ios.jar")) outputDir = file("xcode/native/ios")

with this line

if (".*natives-ios.*")) outputDir = file("xcode/native/ios")
  1. Add Metal AND OpenGLES(don’t know really why but is still needed for some EAGL stuff.) in XCode to the Frameworks

Then everything should work the same as before, just faster! But keep in mind that this isn’t as well tested as the standard libGDX OpenGL implementation.

P.S: If you are working with the MOE Version 1.9.0-SNAPSHOT this wont work out of the box. You would need to add “-lc++” as a custom linker flag. But since you are using MOE 1.7.4 this shouldn’t be a problem for you. Later this will be probably again the default behavior(