Setup libGDX project using MOE plugin

How to setup the libGDX project using MOE plugin.
If i try to select ios-moe at the setup of libGDX project then my build fails with following error.

Generating app in /Users/USERNAME/Desktop/PaxPlay/libGDXProjects/SampleGame
Executing ‘/Users/USERNAME/Desktop/PaxPlay/libGDXProjects/SampleGame/gradlew clean --no-daemon’
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.10/userguide/gradle_daemon.html.
Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘SampleGame’.

Could not resolve all dependencies for configuration ‘:classpath’.
Could not find com.intel.gradle:moeGradlePlugin:1.1.0.final-1.
Searched in the following locations:
file:/Users/USERNAME/.m2/repository/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
file:/Users/USERNAME/.m2/repository/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
https://repo1.maven.org/maven2/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
https://repo1.maven.org/maven2/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
https://oss.sonatype.org/content/repositories/snapshots/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
https://oss.sonatype.org/content/repositories/snapshots/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
file:/Applications/Intel/multi_os_engine/gradle/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.pom
file:/Applications/Intel/multi_os_engine/gradle/com/intel/gradle/moeGradlePlugin/1.1.0.final-1/moeGradlePlugin-1.1.0.final-1.jar
Required by:
:SampleGame:unspecified

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 8.492 secs
Done!
To import in Eclipse: File -> Import -> Gradle -> Gradle Project
To import to Intellij IDEA: File -> Open -> build.gradle
To import to NetBeans: File -> Open Project…

Hi Rohit,

LibGDX is being updated to the new open source version of MOE. Once it is done, it will be announced both here and at LibGDX. Please stay tuned.

Best Regards,
Gergely

Till then is there any other way?

Tom-Ski already committed the MOE backend updates to libgdx, so it might be already available (or will be available soon) in the libgdx nightlies, that you could try out.

Still having the same issue.

The project is build successfully after the new setup tool is released. But now it seems there are few sync issues?

I am getting compiler error for IOSMoeLauncher class.
Error:(13, 13) Gradle: error: cannot access Pointer
class file for com.intel.moe.natj.general.Pointer not found

at this function
protected IOSMoeLauncher(Pointer peer) {
super(peer);
}

Dear PaxPlayer,

Whenever you see a failure with a class package starting with com.intel.moe, that means it is trying to use code from an older MOE version. Please upgrade your code to use the new classes which have a package prefix of org.moe.

Hi liliomk,
I have updated the MOE plugin already and created a fresh project using the new setup tool.
This is my auto generated IOSMoeLauncher.Java class. Don’t think I can do much here. Any ideas?

package com.example.samplegame;

import com.badlogic.gdx.backends.iosmoe.IOSApplication;
import com.badlogic.gdx.backends.iosmoe.IOSApplicationConfiguration;
import org.moe.natj.general.Pointer;
import com.example.samplegame.MyGdxGame;

import ios.foundation.NSAutoreleasePool;
import ios.uikit.c.UIKit;

public class IOSMoeLauncher extends IOSApplication.Delegate {

    protected IOSMoeLauncher(Pointer peer) {
        super(peer);
    }

    @Override
    protected IOSApplication createApplication() {
        IOSApplicationConfiguration config = new IOSApplicationConfiguration();
        config.useAccelerometer = false;
        return new IOSApplication(new MyGdxGame(), config);
    }

    public static void main(String[] argv) {
        NSAutoreleasePool pool = NSAutoreleasePool.alloc();
        UIKit.UIApplicationMain(0, null, null, IOSMoeLauncher.class.getName());
        pool.dealloc();
    }
}

So above issue resolves if you change the libGDX version to 1.9.5-SNAPSHOT and there are no more compiler error after that however there are still issues with the plugin.

When I tried to run the app on iOS this is what I got

fatal error: ‘MOE/MOE.h’ file not found
include <MOE/MOE.h>
^
1 error generated.

** BUILD FAILED **

The following build commands failed:
CompileC /Users/rohitgoyal/Desktop/PaxPlay/libGDXProjects/SampleGame/ios-moe/build/moe/xcodebuild/obj/ios-moe.build/Debug-iphonesimulator/ios-moe.build/Objects-normal/i386/main.o ios-moe/main.cpp normal i386 c++ com.apple.compilers.llvm.clang.1_0.compiler
FAILED
CompileC /Users/rohitgoyal/Desktop/PaxPlay/libGDXProjects/SampleGame/ios-moe/build/moe/xcodebuild/obj/ios-moe.build/Debug-iphonesimulator/ios-moe.build/Objects-normal/x86_64/main.o ios-moe/main.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler

(2 failures)
BUILD FAILED

I got the same issue MOE/MOE.h not found
on multi-os engine1.2.0 and libgdx 1.9.5-SNAPSHOT.
Any advice ?

Was it a newly generated project using gdx-setup or an existing project updated to the new version?

For an existing project you will need to update the Xcode project as well. The easiest way would be if you could just replace your old Xcode project with a newly generated one, and re-add any necessary sources.

Here is a topic about the same issue:

Thank you for your reply.
I used this :


And I dont have this error anymore