1

Steps to reproduce:

  • download setur.jar - http://libgdx.badlogicgames.com/download.html
  • generate project for desktop, Android, iOS, HTML
  • open Intellij IDEA, press Open, and select build.gradle
  • wait while gradle will do the staff and than run android project

I am facing some strange issue:

  • 15:32:20 Compilation completed successfully in 11 sec
  • 15:32:20 NullPointerException: null
  • 15:32:30 Error Report Error Submitting Feedback: null Consider creating an issue at Android Issue Tracker

if I press NullPointerException (link), there appears message and stacktrace:

message: Exception in plugin Android Support. x min ago. Occured 2 times since the last clear. Disable plugin... <-- this is a link (if I press this, than Android will be not visible by IDEA at all.

stacktrace:

java.lang.NullPointerException
    at com.sun.proxy.$Proxy169.getMinSdkVersion(Unknown Source)
    at com.android.tools.idea.model.AndroidModuleInfo.getMinSdkVersion(AndroidModuleInfo.java:71)
    at org.jetbrains.android.facet.AndroidFacet.canRunOnDevice(AndroidFacet.java:560)
    at org.jetbrains.android.facet.AndroidFacet.isCompatibleDevice(AndroidFacet.java:536)
    at org.jetbrains.android.run.DeviceChooser$MyDeviceTableModel.getValueAt(DeviceChooser.java:352)
    at javax.swing.JTable.getValueAt(JTable.java:2716)
    at com.intellij.ui.table.JBTable.getRowHeight(JBTable.java:149)
    at javax.swing.JTable.getRowHeight(JTable.java:993)
    at javax.swing.JTable.getCellRect(JTable.java:2936)
    at javax.swing.JTable.valueChanged(JTable.java:4697)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:184)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:164)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:211)
    at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:405)
    at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:415)
    at javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:459)
    at org.jetbrains.android.run.DeviceChooser.updateTable(DeviceChooser.java:227)
    at org.jetbrains.android.run.DeviceChooser.init(DeviceChooser.java:150)
    at org.jetbrains.android.run.ExtendedDeviceChooserDialog.<init>(ExtendedDeviceChooserDialog.java:124)
    at org.jetbrains.android.run.AndroidRunningState.execute(AndroidRunningState.java:245)
    at com.intellij.execution.runners.DefaultProgramRunner.doExecute(DefaultProgramRunner.java:38)
    at org.jetbrains.android.run.AndroidDebugRunner.doExec(AndroidDebugRunner.java:144)
    at org.jetbrains.android.run.AndroidDebugRunner.doExecute(AndroidDebugRunner.java:135)
    at com.intellij.execution.runners.GenericProgramRunner$1.execute(GenericProgramRunner.java:48)
    at com.intellij.execution.impl.ExecutionManagerImpl$2.run(ExecutionManagerImpl.java:208)
    at com.intellij.openapi.project.DumbServiceImpl.runWhenSmart(DumbServiceImpl.java:95)
    at com.intellij.execution.impl.ExecutionManagerImpl$1$1.run(ExecutionManagerImpl.java:172)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Aleksandrs
  • 1,488
  • 1
  • 14
  • 34
  • possible duplicate of [What is a Null Pointer Exception, and how do I fix it?](http://stackoverflow.com/questions/218384/what-is-a-null-pointer-exception-and-how-do-i-fix-it) – CodeSmile Oct 31 '14 at 19:00
  • I haven't write any code yet, I know whats mean NullPointerException.. I don't know what to do when something wrong with library which is needed to run successfully project.. I ran libGDX project out of the box.. and nullpointer appears.. could someone try to setup new libgdx project at this moment? thanks – Aleksandrs Oct 31 '14 at 20:40
  • 2
    are you using the android studio (and not the intellij ultimate)? does it work when using gradle directly? could as well be a problem with your installed android sdk etc. all this android/swing/awt stacktrace does not look like a problem with GDX but more like one with tooling. – cfrick Oct 31 '14 at 20:44
  • ok, thx for reply, I will try to use Android Studio.. – Aleksandrs Oct 31 '14 at 21:01
  • Thanks a lot!!! It is working now. I tried with Android studio. – Aleksandrs Oct 31 '14 at 21:09

2 Answers2

1

Android does not support Swing & Awt API. So your project should not depend on swing.* / awt.* packages if you want to run it on Android.

You should use the libgdx GUI elements only if you want your game to be cross-plattform. This guide should get you started: https://github.com/libgdx/libgdx/wiki/Scene2d

donfuxx
  • 11,277
  • 6
  • 44
  • 76
0

This is a bug that occurs with IntelliJ 13.x, the fix never made it into that branch.

IntelliJ 14+ and newer versions of Android Studio don't have this issue.

Source: Android Open Source Project Issue

Woz
  • 1
  • 1