New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start RoboVM iOS in IntelliJ due to NullPointerException #242

Open
luveti opened this Issue Dec 7, 2017 · 21 comments

Comments

Projects
None yet
9 participants
@luveti
Copy link

luveti commented Dec 7, 2017

Issue details

I'm unable to launch a RoboVM iOS configuration.

Reproduction steps/code

  1. Create a new libGDX project using the libGDX project generator. I targeted: Desktop, Android, and iOS on this. I also enabled Kotlin support, and had Freetype and Box2d checked.
  2. Create and attempt to run a configuration like specified below.

Configuration

Build Tools:

  • IDEA plugin - 2.3.4-SNAPSHOT (fails with same error on 2.3.3 as well)
  • Eclipse plugin
  • Gradle plugin

Versions:

  • Robovm: 2.3.3
  • XCode: 9.1
  • JDK: 1.8.0_101
  • libGDX: 1.9.7

Build Targets:

image


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:114)
	at com.intellij.execution.configurations.CommandLineState.execute(CommandLineState.java:80)
	at org.robovm.idea.running.RoboVmRunner.doExecute(RoboVmRunner.java:79)
	at com.intellij.execution.runners.GenericProgramRunner$execute$$inlined$runProfileStarter$1.executeAsync(GenericProgramRunner.kt:69)
	at com.intellij.execution.runners.GenericProgramRunnerKt$startRunProfile$$inlined$runProfileStarter$1.executeAsync(GenericProgramRunner.kt:69)
	at com.intellij.execution.impl.ExecutionManagerKtImpl$startRunProfile$startRunnable$1.run(ExecutionManagerKtImpl.kt:75)
	at com.intellij.openapi.application.TransactionGuardImpl.a(TransactionGuardImpl.java:88)
	at com.intellij.openapi.application.TransactionGuardImpl.a(TransactionGuardImpl.java:74)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.a(LaterInvocator.java:424)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
	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:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
	at com.intellij.ide.IdeEventQueue.h(IdeEventQueue.java:822)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	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)
@dkimitsa

This comment has been minimized.

Copy link
Contributor

dkimitsa commented Dec 7, 2017

hi, please check you run configuration: before launch section. there should be 'Build' item in the list. if it is not -- add it manually.

@fechy

This comment has been minimized.

Copy link

fechy commented Dec 10, 2017

Hi, I get the same thing with the new IntelliJ 2017.3. Same error.

@dkimitsa the 'Build' item that you mention is in the list, and judging by the screenshot that @luveti added he has it too.

Both Run and Debug fail.

@Longri

This comment has been minimized.

Copy link

Longri commented Dec 10, 2017

I'm having the same error, after the update to 2017.3

latest PlugIn-snapshot (10-Dec-2017 00:11)

@dkimitsa

This comment has been minimized.

Copy link
Contributor

dkimitsa commented Dec 11, 2017

hi, updated to 2017.3 and was not able to run debug build of plugin as every open dialog just hang. Rolled back to 2017.2 for now. Will be back on it once there is something from Intellij (https://youtrack.jetbrains.com/issue/IDEA-183584)

@fechy

This comment has been minimized.

Copy link

fechy commented Dec 12, 2017

Update just FYI, tried new IntelliJ 2017.3.1 update and the latest RoboVM 2.3.4-SNAPSHOT Plug in and the same result.

@luveti luveti closed this Dec 13, 2017

@luveti luveti reopened this Dec 13, 2017

@luveti

This comment has been minimized.

Copy link
Author

luveti commented Dec 13, 2017

Oops didn't mean to close that! I wanted to point out that "Build" is definitely in there (it's in the screenshot above).

@misha-bear

This comment has been minimized.

Copy link

misha-bear commented Jan 9, 2018

Hey guys, any update how to resolve this issue?

@dkimitsa

This comment has been minimized.

Copy link
Contributor

dkimitsa commented Jan 10, 2018

still unable to debug due idea bug. will try different way later today

@dkimitsa

This comment has been minimized.

Copy link
Contributor

dkimitsa commented Jan 11, 2018

meanwhile checked on Windows Idea 2017.3.2 and it was able to deploy and start application. sorry can't test on Mac yet

@dkimitsa

This comment has been minimized.

Copy link
Contributor

dkimitsa commented Jan 16, 2018

@misha-bear
there is PR which fixes few moments. At least 2017.3.2 is working for me

@misha-bear

This comment has been minimized.

Copy link

misha-bear commented Jan 16, 2018

@dkimitsa
Thanks a lot mate! I'm using 2017.3.2 on Mac. I'm trying to checkout your PR and build plugin locally.

@misha-bear

This comment has been minimized.

Copy link

misha-bear commented Jan 17, 2018

Tried with the latest changes, still having the same problem :(
Looks like in RoboVmRunProfileState (line 52) runConfig.getConfig(); returns null. That's why line 57 fails with NullPointerException. Do you have any clues why it might be the case?

@dkimitsa

This comment has been minimized.

Copy link
Contributor

dkimitsa commented Jan 17, 2018

@misha-bear thanks for result, the case is RoboVmCompileTask is not being called in stack of compiler by Idea. So it is not being configured and compiled to Native. this means that project was not imported properly

can you tell what version of gradle is being used ? is it wrapper or local gradle disctribution.
also would help if you try the case and then look into idea log file (help-show log in finder) for any possible exceptions there.
thank you

@dkimitsa

This comment has been minimized.

Copy link
Contributor

dkimitsa commented Jan 17, 2018

@misha-bear there are new findings, it seems to be related to https://youtrack.jetbrains.com/issue/IDEA-122904 bug, could you please try removing android project from settings.gradle and build.gradle, resync project and try agains ?

@misha-bear

This comment has been minimized.

Copy link

misha-bear commented Jan 17, 2018

Removing Andorid didn't help. Same result.
BUT I switched from IntelliJ to Android Studio, imported the same project, and everything started to work. So I'm going to use AS instead.
RoboVM is awesome! Thanks a lot for your work, mate.

@varrav

This comment has been minimized.

Copy link

varrav commented Mar 5, 2018

I have found that problem appears only when Android is included while generating the project via gdx-setup.jar

There is a workaroud:
open ios.iml and remove

<component name="FacetManager">
    <facet type="android-gradle" name="Android-Gradle">
      <configuration>
        <option name="GRADLE_PROJECT_PATH" value=":ios" />
      </configuration>
    </facet>
    <facet type="java-gradle" name="Java-Gradle">
      <configuration>
        <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
        <option name="BUILDABLE" value="true" />
      </configuration>
    </facet>
  </component>

ios projects starts to run.

In Android Studio 3.0 all works fine in any case

@fgnm

This comment has been minimized.

Copy link

fgnm commented Mar 29, 2018

I have the same issue after upgrade Android Studio from 3.0.1 to 3.1, removing lines suggested by @varrav worked, but every time I restart the IDE the problem appears again.. Is there a persistent solution?

@dotw

This comment has been minimized.

Copy link

dotw commented Apr 11, 2018

I have upgraded my AS to 3.1 and get a similar issue. Following the suggestion of @varrav . The error is gone but the app failed to startup with ClassNotFound error.

@dotw

This comment has been minimized.

Copy link

dotw commented Apr 11, 2018

update: I rearrange project dependencies again, add many duplicated dependencies to the core for ios. the app can run now. This confused me. Why the previous version doesn't these adjustments?

@marcdubs

This comment has been minimized.

Copy link

marcdubs commented May 20, 2018

@varrav's comment fixed it for me. Thanks. Still strange, however.

@dkimitsa

This comment has been minimized.

Copy link
Contributor

dkimitsa commented May 21, 2018

@marcdubs it is know bug at Idea/Google side. Here are some details https://youtrack.jetbrains.com/issue/IDEA-122904
I have been trying to fight it time-to-time with google code fixing etc but at some point fixes stopped working. I ended up with idea plugin that removes these facets. It has issues in AS3 but works for me in Idea. Details in the post by the link.
https://dkimitsa.github.io/2018/05/04/idea-fixing-android-gradle-facet3/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment