Can not launch ipad-iphone simulator in libgdx project - libgdx

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?

Related

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.

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

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

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.

Windows Phone 8 Application doesn't run if installed from Market

I have a strange problem. I have a windows phone 8 application, which is successfully installed on the phone under Visual Studio and works. If I deploy my xap using deployment tool it also works. It is successfully submitted on market. But when I download the app on the same phone from market it fails to run. It writes "load....." and that's all.
What may be reason of such behavior?
It is a Beta version? or a certified Version?
If it's just a beta version you can create a "logger" for catch all error when you quit your application in
App.xaml.cs::Application_UnhandledException
and in
App.xaml.cs::RootFrame_NavigationFailed
this is a sample:
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
// Call your logger class for catch the message exception before application was killed.
Logger.Debug(e.ExceptionObject.Message);
if (System.Diagnostics.Debugger.IsAttached)
{
// An unhandled exception has occurred; break into the debugger
System.Diagnostics.Debugger.Break();
}
}
You juste save the message, or/and the stackTrace and send you the error by mail.
Also, you can try publish your application on "hidden" on the store.
If the certification team can launch your application, and they're found no error, you can download it with your link. And try to install in your device.
Else, the team found an error, you received a documentation explain why your certification failed...
If it's an Certified Application, I've no Idea for this bug... :'( Maybe you call a invalid server when the application launch or a other error launch an exception?? But It's strange that work with VisualStudio and the .xap deployement...
If you find the solution of your problem, I'm interested :-)

Getting java.io.IOException when running JUnit test case in Eclipse

Here's my code
public class JWebUnitTest extends WebTestCase {
public JWebUnitTest(String name) {
super(name);
}
public void setUp() {
getTestContext().setBaseUrl("http://www.google.com");
}
public void testSearch() {
beginAt("/");
setFormElement("q", "httpunit");
submit("btnG");
clickLinkWithText("HttpUnit");
assertTitleEquals("HttpUnit");
assertLinkPresentWithText("User's Manual");
}
}
In the Failure Trace, I see the following error:
java.lang.RuntimeException: java.io.IOException
(moving down..)
Caused by: java.net.SocketException: Operation timed out: connect: could be due to invalid address
Why is "http://www.google.com/" an invalid address?
Why am I getting this IOException?
Since you classified this as "in Eclipse", is this only happening within Eclipse? Can you try running the same outside of Eclipse?
Assuming you have network connectivity to http://www.google.com with a web browser on the same machine, it is likely a proxy issue. Either you need a proxy, and the JVM isn't configured to use one - or you don't need a proxy, and the JVM is being configured to use one. (Are you running this on a corporate or other organizational network?) See http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html for details on how to do this.
I would suggest you to try any of these options
1.) Clean the project once . Project - Clean (in Eclipse) and rebuild
2.) Try updating your eclipse to latest version
3.) Try to hit your localhost server (This will show whether theres really a problem with ur code or with eclipse)
4.) You should be needing a proxy. So configure accordingly