Google play services

So i had a look for google play services and found a couple of libs here.
I managed to get extension-googleplayservices-lib compiling but the other one, extension-googleplaygames is giving me a headache.
Getting this error:

BUILD FAILED
C:\Development\Android SDK\tools\ant\build.xml:573: java.lang.StackOverflowError

The only part of the instructions I haven’t followed is the bit about editing the project.properties file.
How do I do that, make a copy of the project properties in the release build then set up a template pointing to it in the project.xml?

That’s usually how it’s done.

If that doesn’t work, you could try switching to Gradle (available in Lime’s develop branch) in hopes that you’ll get a more useful error message.

Yeah the project properties didn’t work either.
How do I go about switching to gradle?
Or do you know of a better way to implement google play services?

To switch to Gradle, install Lime from Git:

> haxelib git lime https://github.com/openfl/lime.git

This will give you “NDLL not found” errors. To fix these, open up HaxeToolkit/haxe/lib/lime, then open “4,0,3” in one window and “git” in another. Finally, copy the ndll folder from 4,0,3 into git.

If I remember correctly, you’ll also get an error along the lines of “command-line tools not found.” If so, navigate to HaxeToolkit/haxe/lib/lime/git/tools in the command line, and run “haxe tools.hxml.”

With all that done, you can compile as normal, and Lime will use Gradle instead of Ant. I’ll get back to you about all the things you can do with Gradle; for now, just try building your app as-is.

By the way, once you’ve done all this setup, it becomes easy to switch between Gradle and Ant:

> haxelib set lime 4.0.3
> lime test android
> haxelib set lime git
> lime test android

That first one will build with Ant, and the second will use Gradle.

Getting this error
Error: Source path “C:\Users\openfl/lime/git/ndll/Android/liblime-v7.so” does not exist
Couldn’t find /lime/git/tools under HaxeToolkit but I found it under openfl so I ran the command from there, didn’t seem to do anything

Did you copy over the ndll folder?

Take everything in C:\Users\openfl/lime/4,0,3/ndll and copy it into C:\Users\openfl/lime/git/ndll. Skip the ones that are already there.

Ok I couldn’t find 4,0,3 so i used the ndll from 3,0,3, will that make much of a difference?
Getting this error now

FAILURE: Build failed with an exception.

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

failed to find Build Tools revision 24.0.1

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

Installed build tool 24.0.1 from the SDK manager and made some progress.
Now I’m getting

:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: C:\Users\Desktop\Decent Projects\Zephyr\bin\android\debug\bin\app\src\main\java\org\libsdl\app\SDLActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

I’m deleting API 16 and 19 to make space for API 23.
Not sure if i’m going in the right direction but i’m out of ideas

That didn’t work either:

  • What went wrong:
    Execution failed for task ‘:app:transformClassesWithDexForDebug’.

com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:\Program Files\Java\jdk1.6.0_37\bin\java.exe’’ finished with non-zero exit value 1

Any ideas?

Ok got this error after editing build.gradle and gradle.properties to include:

dexOptions {
javaMaxHeapSize “2g”
}

and:

org.gradle.jvmargs=-Xmx3072m

Error message:

To run dex in process, the Gradle daemon needs a larger heap.
It currently has approximately 455 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB.
To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html
java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: com.android.dx.command.Main. Program will exit.
Picked up _JAVA_OPTIONS: -Xmx512M
Exception in thread "main"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: com.android.dx.command.Main. Program will exit.
Picked up _JAVA_OPTIONS: -Xmx512M
Exception in thread “main”
:app:transformClassesWithDexForDebug FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:transformClassesWithDexForDebug’.

com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:\Program Files\Java\jdk1.6.0_37\bin\java.exe’’ finished with non-zero exit value 1

  • 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: 6.268 secs
Picked up _JAVA_OPTIONS: -Xmx512M
Build halted with errors.
Done(1)

Solved

Changed _JAVA_OPTIONS from -Xmx512m to -Xmx2048M