Libgdx for iOS with RoboVM - Unsatisfied link error at IOSGLES20.init
Asked Answered
S

2

9

Trying to port my LibGDX game to iOS using RoboVM.

When running the app for the emulator I get this error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: 
at com.badlogic.gdx.backends.iosrobovm.IOSGLES20.init(Native Method)
at com.badlogic.gdx.backends.iosrobovm.IOSGLES20.<init>(IOSGLES20.java)
at com.badlogic.gdx.backends.iosrobovm.IOSApplication.didFinishLaunching(IOSApplication.java)
at com.badlogic.gdx.backends.iosrobovm.IOSApplication$Delegate.didFinishLaunching(IOSApplication.java)
at org.robovm.cocoatouch.uikit.UIApplicationDelegate$Callbacks.didFinishLaunching(UIApplicationDelegate.java)
at org.robovm.cocoatouch.uikit.UIApplication.UIApplicationMain(Native Method)
at org.robovm.cocoatouch.uikit.UIApplication.main(UIApplication.java)
at ***********
Sphingosine answered 17/2, 2014 at 13:49 Comment(1)
I have the same problem, with the smae class (IOSGLES20)Lippizaner
S
0

if you have this problem, here's how I solved it: I took an advice from someone on an older forum: -save your classes from the main project -delete the entire project -rebuild from scratch using LibGDX UI Setup -copy back your classes in the main project.

As that guy said, there's always gonna be some very small glitch somewhere that you're missing.

I wasted 3-4 hours with this, then I took tha advice and everything worked like charm :)

Sphingosine answered 27/2, 2014 at 14:39 Comment(1)
I'm experiencing this issue right now and this 'solution' didn't solve it. Did you face the same problem again? If so, do you know an actual solution?Sherleysherline
O
7

Ok, sounds like you might have done an upgrade to libGDX 1.6.1+

Look in your main build.gradle file for lines that read as follows:

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

If you have such lines change them to read (changes natives to compile):

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

And see if that fixes the issue.

I just went through several hours not realizing that I had missed a step during update to a newer libGDX and that roboVM is no longer including the bins as part of the ipa build as they are now packaged as JAR's that get sucked in via compile. (no more lib entries in the robovm.xml for these either)

Oneeyed answered 20/6, 2015 at 5:12 Comment(1)
While you're there fixing up the s/natives/compile/, you can also cleanup the ios/build.gradle file: you can remove the copyNatives and updateRoboVMXML tasks and any other line that references those tasks (per the libGDX 1.6.1 release notes: badlogicgames.com/wordpress/?p=3694). Thanks for this fix btw - completely missed it and had the same problem!Hintz
S
0

if you have this problem, here's how I solved it: I took an advice from someone on an older forum: -save your classes from the main project -delete the entire project -rebuild from scratch using LibGDX UI Setup -copy back your classes in the main project.

As that guy said, there's always gonna be some very small glitch somewhere that you're missing.

I wasted 3-4 hours with this, then I took tha advice and everything worked like charm :)

Sphingosine answered 27/2, 2014 at 14:39 Comment(1)
I'm experiencing this issue right now and this 'solution' didn't solve it. Did you face the same problem again? If so, do you know an actual solution?Sherleysherline

© 2022 - 2024 — McMap. All rights reserved.