Robovm Libgdx demo fails at runtime with unresolved native function for objc_getSharedAccelerometer - libgdx

I have run the "hello world cocoa" example from the robovm official site successfully.
But when I run the libgdx robovm demo, while it compiles OK, it fails with a runtime error.
I have followed every step of the wiki.
Do you have any advice?
[debug] IOSApplication: View: Portrait 320x480
[debug] IOSGraphics: 320.0x480.0, 1.0
[debug] IOSGraphics: Calculating density, UIScreen.mainScreen.scale: 1.0
[debug] IOSGraphics: Display: ppi=163, density=1.0
Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to resolve native function for method private static native org.robovm.cocoatouch.uikit.UIAccelerometer org.robovm.cocoatouch.uikit.UIAccelerometer.objc_getSharedAccelerometer(org.robovm.objc.ObjCClass,org.robovm.objc.Selector) with bridge annotation #org.robovm.rt.bro.annotation.Bridge(symbol=) in library #org.robovm.rt.bro.annotation.Library(value=UIKit)
at org.robovm.rt.bro.Runtime.resolveBridge(Runtime.java)
at org.robovm.rt.bro.Bro.bind(Bro.java)
at org.robovm.objc.ObjCRuntime.bind(ObjCRuntime.java)
at org.robovm.cocoatouch.uikit.UIAccelerometer.<clinit>(UIAccelerometer.java)
at com.badlogic.gdx.backends.iosrobovm.IOSInput.setupAccelerometer(IOSInput.java)
at com.badlogic.gdx.backends.iosrobovm.IOSInput.setupPeripherals(IOSInput.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 com.badlogicgames.superjumper.SuperJumperIOS.main(SuperJumperIOS.java)

The libgdx RoboVM backend only works properly with the latest nightly build of RoboVM and from the stacktrace you posted I guess you're using an older version. Please try the latest build from http://download.robovm.org.

Related

Houdini arm to x86 translation "Unsupported feature" error when using shared STL in Android NDK app

I created an Android Studio project from this sample NDK project provided by Google and changed a couple things so I could try to leverage Houdini arm to x86 translation:
In app/build.gradle I set abiFilters to armeabi-v7a.
In Application.mk I changed APP_ABI from all to armeabi-v7a so that x86 native libraries won't be created.
Also in Application.mk, I changed APP_STL from stlport_static to gnustl_shared.
You can see the modified code in this repo.
Then I ran the app in the BlueStacks emulator, which supports Houdini. I get the following error:
11-21 00:42:19.742 9947-9947/? D/houdini: [9947] Loading library(version: 4.0.8.45720 RELEASE)... successfully.
11-21 00:42:19.742 9947-9947/? D/houdini: [9947] Unsupported feature (ID:0x10600cae).
11-21 00:42:19.742 9947-9947/? D/houdini: [9947] Open Native Library /data/app-lib/com.sample.teapot-2/libTeapotNativeActivity.so failed.
...
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sample.teapot/com.sample.teapot.TeapotNativeActivity}: java.lang.IllegalArgumentException: Unable to load native library: /data/app-lib/com.sample.teapot-2/libTeapotNativeActivity.so
If I make APP_STL any of the supported values with shared I get this error, and with static it works fine. I'd like to get shared working, to solve this issue in React Native. Does shared STL not work with Houdini? Any workarounds?

Multi-OS Engine build failed in Android Studio

I'm recently getting an error building a Multi-OS engine project using LibGDX in Android Studio. This is the output from the Multi-OS Engine console:
ERROR: Failed to upgradeonly on device, Unknown error
Command failed: [/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java, -Dfile.encoding=UTF-8, -Duser.country=US, -Duser.language=en, -Duser.variant, -jar, /Users/camilo/.moe/moe-sdk-1.3.0-beta-2/tools/ios-device.jar, --app-path=/path/to/my/project/ios-moe/build/moe/xcodebuild/Debug-iphoneos/MyApp.app, --wait-for-device, --launch-arg=-args, --launch-arg=--debug, --install-mode=upgradeonly]
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ios-moe:moeLaunch'.
> Process exited with non-zero exit value
* Try:
:ios-moe:moeLaunch FAILED
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
My gradle looks like this:
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'org.multi-os-engine:moe-gradle:1.3.3'
}
}
LibGDX version = 1.9.6
Nonetheless the Application is installed in the device, but I cannot see the logs in the console. When I change the build target to Simulator it works just fine.
Problem solved, my iPhone has updated to 10.3.1 and Xcode didn't have the DeveloperDiskImage corresponding to the latest iOS version, so I had to update Xcode too to version 8.3.1.

Can not launch ipad-iphone simulator in libgdx project

I am developing a libgdx project. I want to deploy the project to android and ios. The project is working on desktop(MacOS) ,android simulator and android device. However, when I try to launch IOS simulators with gradle or main class, errors are throwed. Also I downloaded some another robovm example. These projects can launch simulators with similar code.
Libgdx IOS main class is as follows:
public class IOSLauncher extends IOSApplication.Delegate {
#Override
protected IOSApplication createApplication() {
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
return new IOSApplication(new DemoProject(), config);
}
public static void main(String[] argv) {
NSAutoreleasePool pool = new NSAutoreleasePool();
UIApplication.main(argv, null, IOSLauncher.class);
pool.close();
}
}
Error is as follows:
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.robovm.rt.VM.getStackClasses(II)[Ljava/lang/Class;
at org.robovm.rt.VM.getStackClasses(Native Method)
at org.robovm.rt.bro.Bro.bind(Bro.java:50)
at org.robovm.objc.ObjCRuntime.<clinit>(ObjCRuntime.java:43)
at org.robovm.objc.ObjCObject.<clinit>(ObjCObject.java:57)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)
In fact, I prefer to run gradle.
But it throws error is as follows:
Executing external task 'launchIPhoneSimulator'...
Configuration on demand is an incubating feature.
:core:compileJava UP-TO-DATE
:core:processResources UP-TO-DATE
:core:classes UP-TO-DATE
:core:jar UP-TO-DATE
:ios:compileJava UP-TO-DATE
:ios:processResources UP-TO-DATE
:ios:classes UP-TO-DATE
:ios:jar UP-TO-DATE
:ios:assemble UP-TO-DATE
:ios:compileTestJava UP-TO-DATE
:ios:processTestResources UP-TO-DATE
:ios:testClasses UP-TO-DATE
:ios:test UP-TO-DATE
:ios:check UP-TO-DATE
:ios:build UP-TO-DATE
:ios:launchIPhoneSimulator FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ios:launchIPhoneSimulator'.
> Failed to launch IOS Simulator
* 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: 0.743 secs
/Users/burakdagli/.m2/repository/org/robovm/robovm-dist/1.2.0/unpacked/robovm-1.2.0/bin does not exist.
14:34:13: External task execution finished 'launchIPhoneSimulator'.
How can I proceed?

How to reslove instrumentation error in selendroid?

I have given following coding to start android device.While running,it points the android device and it creates the Android driver App in android device,after that it throws the following error message.
WebDriver driver = new RemoteWebDriver(DesiredCapabilities.android());
driver.get("url");
Error message:
Failed tests: setUp(mobileweb.photocentric.ScrollArticleTest): Could not start the app under test using instrumentation.
INSTRUMENTATION_STATUS: id=ActivityManagerService
INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: ComponentInfo{io.selendroid.io.selendroid.androiddriver/io.selendroid.server.ServerInstrumentation}
INSTRUMENTATION_STATUS_CODE: -1
android.util.AndroidException: INSTRUMENTATION_FAILED: io.selendroid.io.selendroid.androiddriver/io.selendroid.server.ServerInstrumentation
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:301)
at dalvik.system.NativeStart.main(Native Method)
I had the same problem and I found out that the androiddriver package was conflicting with a previous version installed in my device.
Try uninstalling the package from your device with the following command:
adb shell pm uninstall io.selendroid.io.selendroid.androiddriver

Monodevelop 2.8.6 on windows

I hope someone can answer this as its driving me crazy. I have installed Monodevelop on windows XP. The version being 2.8.6.5. I set the default/active runtime as Microsoft .Net and set my projects to target .net 4.0 via project settings BUILD-->General->Target framework.
When I debug it from the application output window it loads XSP 2.0 and tries to the old .Net 2 DLL's ie from the .Net 2 GAC - C:\windows\assembly instead of the .Net 4 GAC.
when I debug setting Mono as the active runtime it works ok.
I get the error, which is understandable given the fact the build is targeting .Net 4 yet its looking at the wrong runtime:
Could not load file or assembly 'TestWeb' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'TestWeb' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Here is the output from the Output window:
Loaded Module 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'
Started Thread 1872
Loaded Module 'C:\Program Files\MonoDevelop\bin\xsp2.exe'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\MonoDevelop.Xsp\2.8.0.0__0738eb9f132ed756\MonoDevelop.Xsp.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'
Loaded Module 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll'
many thanks
Simon.