robovm icon indicating copy to clipboard operation
robovm copied to clipboard

Unable to run the app, NullPointerException

Open piotrros opened this issue 6 years ago • 9 comments

Issue details

After a longer while I wanted to update the app I made (last update on iOS 12). It worked back then, now I cannot run it. Stacktrace below. I've updated everything to the latest version (iOS on the device, android studio, robovm plugin to the latest snapshot, Xcode).

I CAN run the app from console: ./gradlew -Probovm.device.udid=hereismyudid --stacktrace --debug launchIOSDevice

Reproduction steps/code

Just run the app. Device or simulator.

Configuration

iOS 13.2.2 Android Studio 3.5.2

Build Tools:

  • [x] IDEA plugin
  • [ ] Eclipse plugin
  • [ ] Gradle plugin

Versions:

Please provide the version of RoboVM, XCode and JDK used

  • Robovm: 2.3.8-SNAPSHOT
  • XCode: 11.2.1
  • JDK: 1.8

Build Targets:

Every iOS 13 Device or Simulator, I think.

Stacktrace

[ERROR] Couldn't start application
java.lang.NullPointerException
	at org.robovm.idea.running.RoboVmRunProfileState.executeRun(RoboVmRunProfileState.java:57)
	at org.robovm.idea.running.RoboVmRunProfileState.startProcess(RoboVmRunProfileState.java:126)
	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$$inlined$runProfileStarter$1.executeAsync(GenericProgramRunner.kt:56)
	at com.intellij.execution.runners.GenericProgramRunnerKt$startRunProfile$$inlined$runProfileStarter$1.executeAsync(GenericProgramRunner.kt:56)
	at com.intellij.execution.impl.ExecutionManagerKtImpl$startRunProfile$startRunnable$1.run(ExecutionManagerKtImpl.kt:63)
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
	at com.intellij.openapi.application.TransactionGuardImpl.lambda$pollQueueLater$0(TransactionGuardImpl.java:74)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:435)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:419)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:403)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:757)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:706)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:375)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

I've seen a fix, but it's on jdk12 branch. I've tried compiling plugin on my own, but just cannot break through :D

It's probably the same issue at this:

https://github.com/MobiVM/robovm/issues/242

But I cannot believe it's still there after 2 years. Is everyone just running from console?

Can you release new snapshot version with the fix, please?

Or is it another issue?

piotrros avatar Nov 15 '19 14:11 piotrros

Have you tried the workaround explained in the issue you've linked of commenting out the facet from ios.iml?

obigu avatar Nov 15 '19 17:11 obigu

@piotrros build from jdk12 branch expected next week. meanwhile build can be built from sources

dkimitsa avatar Nov 15 '19 20:11 dkimitsa

My bad - I've tried this fix before, but it didn't work. It looks like I edited main iml file, not that one from ios directory. Now I can make an update :) Thanks a lot @obigu

@dkimitsa Nice to hear that. As I said I've tried building from sources, but had a lot of issues with that, so I'll wait for the release.

piotrros avatar Nov 18 '19 07:11 piotrros

As I can see new plugin is out and indeed this issue is gone. However, I'm experiencing new issue, don't know if it's related or not:

[WARNING] 10:50:37.967 More than 1 device connected ([4b193c865d73e0a217e28561e033b4e94607aab3, 859f03ed448de1356ac03127356f041d23f11931, 80441d8f822fbd990d7980decf91b6fe3d9c97d7]). Using 4b193c865d73e0a217e28561e033b4e94607aab3.
[ERROR] Couldn't start application
org.robovm.libimobiledevice.LibIMobileDeviceException: IDEVICE_E_NO_DEVICE

I see this like 50% of the time I try to run the app. Somehow, it sees 2-3 devices connected and picks first. However, I have only one device connected. Reconnecting device works (although is still sees more than 1 device), but after a while issue comes back. Even after reboot is still sees 2-3 devices.

Cleaning Build Folders / Global Cache also didn't help.

piotrros avatar Nov 20 '19 09:11 piotrros

@piotrros please check if you have any Connect via network configured devices in Xcode devices dialog. LibIMobileDevice sees these as device as well

dkimitsa avatar Nov 20 '19 10:11 dkimitsa

Interesting idea. I've just checked that. Unfortunately, none of the devices I have is connected via network.

piotrros avatar Nov 20 '19 10:11 piotrros

@piotrros I would try checking what are these devices in Xcode and remove all but one you are using 4b193c865d73e0a217e28561e033b4e94607aab3, 859f03ed448de1356ac03127356f041d23f11931, 80441d8f822fbd990d7980decf91b6fe3d9c97d7

dkimitsa avatar Nov 20 '19 10:11 dkimitsa

859f03ed448de1356ac03127356f041d23f11931 is my iPhone, other devices I own have different uids then these 2. I don't see any other devices in Xcode, only the one connected via cable. When I run the app on iPhone it says 3 devices, but when I disconnect the iPhone, it says no devices. List in "Devices and simulators" remains empty.

piotrros avatar Nov 21 '19 08:11 piotrros

@piottros, in ios/ios.iml make sure the module element is completely empty and run. Sometimes it needs a couple of runs before it starts compiling.

cellcrowd avatar Jan 03 '20 16:01 cellcrowd