1

Primary topic:

Please help me with a problem encountered in attempt to begin Android project in Eclipse. Please note that I want to use Eclipse and not to install another IDE.

Secondary:

I want to know if this Eclipse/Android environment has this many bugs in daily use as well. Only (yes, only) if this is the case I would want to know what practical solution is there to develop Android applications on a low-profile Ubuntu PC.

Problem:

  • Ran New Android project wizard in Eclipse first time after install of the Android SDK plug-in.

  • After it was completed, the following message appeared:

    Errors occurred during the build.
    
    Errors running builder 'Android Resource Manager' on project 'pr1Android'.
    
    java.lang.NullPointerException
    

From the log file:

  1. Failed to load properties file for project 'pr1Android'

  2. Problems occurred when invoking code from plug-in: org.eclipse.core.resources.

    java.lang.NullPointerException
        at com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder.abortOnBadSetup(BaseBuilder.java:327)
        at com.android.ide.eclipse.adt.internal.build.builders.ResourceManagerBuilder.build(ResourceManagerBuilder.java:92)
        at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
        at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
        at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
        at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
        at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
        at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
    

Circumstance:

Dan
  • 11

1 Answers1

0

Please note that I have no idea as to the path of your JVM, as I have yet to install Java on my fresh Ubuntu 16.04 VirtualBox image, but this should get you started on the right path (pun intended).

You should have an eclipse.ini file located at $ECLIPSE_HOME/eclipse.ini

  1. Open the above file: gedit $ECLIPSE_HOME/eclipse.ini. For in-depth coverage of the file, refer to the References below.
  2. Find the line that reads -vmargs. Insert a blank line above it.
  3. On the Blank line add: -vm, and hit Enter to create another new line.
  4. On the Blank line, enter the PATH value for your Java machine, i.e. /opt/jdk-1.8.0_91/bin/java. Please note that the path could be very different.
  5. Make sure JAVA_HOMEand JDK_HOME are set. See How to set JAVA_HOME for Java?. Be sure to look at the pastebin comment if you have multiple versions.
  6. Logout and back in to accept the changes from Step 5.
  7. If all works well, I believe you can set -vm to the exported value in JAVA_HOME. If that fails after restarting Eclipse, I'll remove this step.

Regarding issues with Eclipse, I haven't had any major issues, but for Android Development, I actually prefer Android Studio, as it's the official IDE endorsed by Android. The reason you might consider it bloated is because the IDE settings are configured in such a way that the increased bloat is used to support those settings, I.e. type-checking for a hard-coded string, and the integrated layout editor.

References

java.lang.NullPointerException when creating first android app in OS X 10.9.4

Eclipse Wiki - eclipse.ini

eyoung100
  • 655
  • 3
  • 16
  • The same problem appears. The change in eclipse.ini already changed (forgot to mention in the post), and now also added the JAVA_HOME and JDK_HOME with the same directory path. You have another idea? Thanks for your effort in any case – Dan Jun 25 '16 at 14:56
  • What happens if: 1) You remove the change from my answer? 2) You downgrade Java to JDK/JRE-7? I have a hunch that you're going to need to try #2 with multiple versions until you find a match that works. If this is the case the plugin is version specific. – eyoung100 Jun 25 '16 at 18:25
  • That would complicate me too much. There could be bugs in java 7 that will retroactively return problems corrected in java 8, with ubuntu 16.04, the IDE, etc. – Dan Jun 26 '16 at 12:19
  • @Dan if that's how you feel then remove the plugin, otherwise try the last version of Java 7. This issue smells of a regression issue. The only way to test if that's true is to regress Java since you can't upgrade the plugin. If downgrading solves the issue, then you file a bug for the plugin. Otherwise try Android studio. – eyoung100 Jun 26 '16 at 13:31