robovm icon indicating copy to clipboard operation
robovm copied to clipboard

Running on a connected device keeps crashing on different errors

Open yahel-ck opened this issue 1 year ago • 12 comments

Issue details

Running a LibGDX app on a physical iOS device keeps failing on different errors, each time I run I get a [ERROR] Couldn't start application error with one of the following exceptions:

  • org.robovm.libimobiledevice.LibIMobileDeviceException: LOCKDOWN_E_INVALID_CONF
  • java.lang.RuntimeException: No devices connected (even though a device is connected and I was able to run an app on it with Xcode)
  • org.robovm.libimobiledevice.LibIMobileDeviceException: LOCKDOWN_E_PAIRING_DIALOG_RESPONSE_PENDING (I keep getting the "trust device" dialog on random occasions and click trust each time)

I tried this with two different projects and sometimes the app does launch successfully, but one of the apps crashes right away (because of an unrelated error probably) and I'm not getting the traceback of the exception. Instead I get a AppLauncher failed with an exception error from RoboVM with one of the following exceptions:

  • org.robovm.libimobiledevice.LibIMobileDeviceException: DEBUGSERVER_E_UNKNOWN_ERROR
  • org.robovm.libimobiledevice.LibIMobileDeviceException: DEBUGSERVER_E_SSL_ERROR

I was able to run these apps with RoboVM on this IPhone in the past and I think the only things that changed since then are the iOS version and the IDEA RoboVM plugin verison. Any help would be appriciated, thanks!

Configuration

Build Tools:

  • IDEA plugin
  • Gradle plugin

Versions:

  • Robovm: 2.3.19 (I also tried with gradle plugin versions 2.3.12 and 2.3.17 before upgrading all to 2.3.19, to match the IDEA plugin version)
  • XCode: 14.3 (14E222b)
  • JDK: jbr 11

Build Targets:

  • IPhone 11 iOS 16.4.1

Stacktrace

org.robovm.libimobiledevice.LibIMobileDeviceException: DEBUGSERVER_E_SSL_ERROR
	at org.robovm.libimobiledevice.DebugServerClient.checkResult(DebugServerClient.java:195)
	at org.robovm.libimobiledevice.DebugServerClient.receive(DebugServerClient.java:165)
	at org.robovm.libimobiledevice.util.AppLauncher.receiveGdbPacket(AppLauncher.java:449)
	at org.robovm.libimobiledevice.util.AppLauncher.receiveGdbPacket(AppLauncher.java:431)
	at org.robovm.libimobiledevice.util.AppLauncher.pipeStdOut(AppLauncher.java:811)
	at org.robovm.libimobiledevice.util.AppLauncher.launchInternal(AppLauncher.java:760)
	at org.robovm.libimobiledevice.util.AppLauncher.launch(AppLauncher.java:1079)
	at org.robovm.compiler.target.ios.AppLauncherProcess$1.run(AppLauncherProcess.java:67)

org.robovm.libimobiledevice.LibIMobileDeviceException: DEBUGSERVER_E_UNKNOWN_ERROR
	at org.robovm.libimobiledevice.DebugServerClient.checkResult(DebugServerClient.java:195)
	at org.robovm.libimobiledevice.DebugServerClient.receive(DebugServerClient.java:165)
	at org.robovm.libimobiledevice.util.AppLauncher.receiveGdbAck(AppLauncher.java:474)
	at org.robovm.libimobiledevice.util.AppLauncher.sendReceivePacket(AppLauncher.java:484)
	at org.robovm.libimobiledevice.util.AppLauncher.pipeStdOut(AppLauncher.java:788)
	at org.robovm.libimobiledevice.util.AppLauncher.launchInternal(AppLauncher.java:760)
	at org.robovm.libimobiledevice.util.AppLauncher.launch(AppLauncher.java:1079)
	at org.robovm.compiler.target.ios.AppLauncherProcess$1.run(AppLauncherProcess.java:67)

org.robovm.libimobiledevice.LibIMobileDeviceException: LOCKDOWN_E_INVALID_CONF
	at org.robovm.libimobiledevice.LockdowndClient.checkResult(LockdowndClient.java:133)
	at org.robovm.libimobiledevice.LockdowndClient.<init>(LockdowndClient.java:57)
	at org.robovm.libimobiledevice.util.AppLauncher.uploadInternal(AppLauncher.java:1049)
	at org.robovm.libimobiledevice.util.AppLauncher.install(AppLauncher.java:545)
	at org.robovm.compiler.target.ios.AppLauncherProcess.execAsync(AppLauncherProcess.java:62)
	at org.robovm.compiler.target.AbstractTarget.doLaunch(AbstractTarget.java:805)
	at org.robovm.compiler.target.ios.IOSTarget.doLaunch(IOSTarget.java:791)
	at org.robovm.compiler.target.AbstractTarget.launch(AbstractTarget.java:801)
	at org.robovm.compiler.AppCompiler.launchAsync(AppCompiler.java:1017)
	at org.robovm.idea.running.RoboVmRunProfileState.executeRun(RoboVmRunProfileState.java:73)
	at org.robovm.idea.running.RoboVmRunProfileState.startProcess(RoboVmRunProfileState.java:122)
	at com.intellij.execution.configurations.CommandLineState.execute(CommandLineState.java:61)
	at org.robovm.idea.running.RoboVmRunner.doExecute(RoboVmRunner.java:79)
	at com.intellij.execution.runners.GenericProgramRunner$execute$1.invoke(GenericProgramRunner.kt:20)
	at com.intellij.execution.runners.GenericProgramRunner$execute$1.invoke(GenericProgramRunner.kt:19)
	at com.intellij.execution.impl.ExecutionManagerImpl$startRunProfile$1.invoke(ExecutionManagerImpl.kt:179)
	at com.intellij.execution.impl.ExecutionManagerImpl$startRunProfile$1.invoke(ExecutionManagerImpl.kt:177)
	at com.intellij.execution.impl.ExecutionManagerImpl.doStartRunProfile$lambda$2(ExecutionManagerImpl.kt:240)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
	at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:456)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:79)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:122)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:788)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:731)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:758)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:666)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$7(IdeEventQueue.kt:570)
	at com.intellij.openapi.application.impl.ApplicationImpl.withoutImplicitRead(ApplicationImpl.java:1446)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:570)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:68)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:348)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:343)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:994)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:994)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$4(IdeEventQueue.kt:343)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

org.robovm.libimobiledevice.LibIMobileDeviceException: LOCKDOWN_E_PAIRING_DIALOG_RESPONSE_PENDING
	at org.robovm.libimobiledevice.LockdowndClient.checkResult(LockdowndClient.java:133)
	at org.robovm.libimobiledevice.LockdowndClient.<init>(LockdowndClient.java:57)
	at org.robovm.libimobiledevice.util.AppLauncher.uploadInternal(AppLauncher.java:1049)
	at org.robovm.libimobiledevice.util.AppLauncher.install(AppLauncher.java:545)
	at org.robovm.compiler.target.ios.AppLauncherProcess.execAsync(AppLauncherProcess.java:62)
	at org.robovm.compiler.target.AbstractTarget.doLaunch(AbstractTarget.java:805)
	at org.robovm.compiler.target.ios.IOSTarget.doLaunch(IOSTarget.java:791)
	at org.robovm.compiler.target.AbstractTarget.launch(AbstractTarget.java:801)
	at org.robovm.compiler.AppCompiler.launchAsync(AppCompiler.java:1017)
	at org.robovm.idea.running.RoboVmRunProfileState.executeRun(RoboVmRunProfileState.java:73)
	at org.robovm.idea.running.RoboVmRunProfileState.startProcess(RoboVmRunProfileState.java:122)
	at com.intellij.execution.configurations.CommandLineState.execute(CommandLineState.java:61)
	at org.robovm.idea.running.RoboVmRunner.doExecute(RoboVmRunner.java:79)
	at com.intellij.execution.runners.GenericProgramRunner$execute$1.invoke(GenericProgramRunner.kt:20)
	at com.intellij.execution.runners.GenericProgramRunner$execute$1.invoke(GenericProgramRunner.kt:19)
	at com.intellij.execution.impl.ExecutionManagerImpl$startRunProfile$1.invoke(ExecutionManagerImpl.kt:179)
	at com.intellij.execution.impl.ExecutionManagerImpl$startRunProfile$1.invoke(ExecutionManagerImpl.kt:177)
	at com.intellij.execution.impl.ExecutionManagerImpl.doStartRunProfile$lambda$2(ExecutionManagerImpl.kt:240)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
	at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:456)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:79)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:122)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:788)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:731)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:758)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:666)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$7(IdeEventQueue.kt:570)
	at com.intellij.openapi.application.impl.ApplicationImpl.withoutImplicitRead(ApplicationImpl.java:1446)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:570)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:68)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:348)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:343)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:994)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:994)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$4(IdeEventQueue.kt:343)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

yahel-ck avatar Apr 15 '23 09:04 yahel-ck

@yahel-ck thanks for reporting. hadn't tried it on 16.4.1 probably it is related, will check probably tomorrow. any chance you can try older iOS version ? (just to check) also, make sure you are running 2.3.19 Idea plugin as previous had a bug related to starting on ios13+ device.

dkimitsa avatar Apr 17 '23 08:04 dkimitsa

I got the same DEBUGSERVER_E_SSL_ERROR error on an iPad with iOS 16.4.

I also got the same errors on my iPhone before upgrading to iOS 16.4.1 (because I thought it might help) but I'm not sure which iOS version I had before.

yahel-ck avatar Apr 21 '23 10:04 yahel-ck

it indeed failed for me on 16.4.1 first time after device is freshly booted. Second and following launches are successful. investigating into.

dkimitsa avatar Apr 21 '23 14:04 dkimitsa

there is an update to logic in https://github.com/MobiVM/robovm/pull/726 mostly it will provide better error messages and retry logic and cover cases related to development image mounting and LOCKDOWN_E_PAIRING_DIALOG_RESPONSE_PENDING mentioned above.

there is always a moment that something still don't work. libimobiledevice -- a library we use is build using reverse engineering Apple software/protocols. So it not perfect itself and could not able to handle some cases like usbmuxd daemon go into broken state.

as last resort that mostly always work: reboot phone and reboot Mac (to reset usbmuxs)

dkimitsa avatar May 03 '23 16:05 dkimitsa

Cool when/how can I try it out?

Also I'm still getting org.robovm.libimobiledevice.LibIMobileDeviceException: DEBUGSERVER_E_SSL_ERROR when the app does launch successfully, so I can't see the traceback if an exception is thrown. I tried restarting my Mac and iPhone and it didn't help. Is there anything else I can try?

yahel-ck avatar May 13 '23 07:05 yahel-ck

@yahel-ck its available in snapshot build. can be obtained from there https://mobivm.github.io/dev/

dkimitsa avatar May 13 '23 08:05 dkimitsa

another related case fixed: https://github.com/MobiVM/robovm/pull/734

in recent libmobiledevice *SSL_ERROR -- its common error when communication fails. E.g. it doesn't have specific meaning. I played with iphone8 + ios16.5 and was not able to reproduce.

if this case is reproducible at your end -- please share steps to follow

dkimitsa avatar Jul 03 '23 14:07 dkimitsa

also there once was case met when robovm sees no device while Xcode and other tools were working. It was cause by "usbmuxd is not running" error inside libmobiledevice. restart of Intellij Idea fixed it. Was not able to reproduce to investigate.

dkimitsa avatar Jul 03 '23 14:07 dkimitsa

@yahel-ck I also got DEBUGSERVER_E_SSL_ERROR (iPhone 13, kept on iOS 15.6.1). In my case, the app crashed right after launch and I couldn't see any useful logs in Android studio. However, in Xcode, I could access the device console and after trying multiple different search keywords, I found the relevant exception logs. Might have been "IOSlauncher". (Launch already installed app from device) The console is found in Xcode -> Window -> Devices and Simulators -> (pick device) -> (Open console)

@dkimitsa My app crashes during IOSApplication.java didFinishLaunching listener.create() so in my Main create function - perhaps throwing exception at that point reproduces the SSL_ERROR. When launching app from android studio, even the Xcode console misses the crash logs. Only when I launch already installed app from device, the relevant crash logs show up.

KristjanP94 avatar Jul 04 '23 08:07 KristjanP94

@KristjanP94 thanks, SSL_ERROR is verbose error, in your case it should be "Disconnected". But also it would good to receive any java stack trace logs that are piped to console. Will check

dkimitsa avatar Jul 04 '23 09:07 dkimitsa

I updated it to 2.20, because the DEBUGSERVER_E_SSL_ERROR occurred while using 2.19. Then, LOCKDOWN_E_MUX_ERROR occurred. How can I fix this error?

sdringo9 avatar May 07 '24 07:05 sdringo9

@sdringo9 DEBUGSERVER_E_SSL_ERROR -- means that connection to device is terminated. Most likely this happens as your application is crashed. Check Xcode logs. As for LOCKDOWN_E_MUX_ERROR -- its known issue being investigated. thx

dkimitsa avatar May 07 '24 07:05 dkimitsa