5

This issue is supposed to be fixed by the latest ADT release(22.6.2), but I'm still receiving the same error when I'm trying to create an empty Android Application Project. Here is the exact error:

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

Am I missing something here? btw I'm using OSX-Maverics 10.9.2

Lorenborn
  • 71
  • 1
  • 3
  • 1
    missing the code and the stacktrace – Raghunandan Apr 18 '14 at 15:37
  • I didnt even start coding to the project. The error comes in the create project screen. however, in console this error-message shows:[2014-04-18 18:31:35 - MyFirstApp] Project has no project.properties file! Edit the project properties to set one. – Lorenborn Apr 18 '14 at 15:40
  • then do that. edit the project properties – njzk2 Apr 18 '14 at 15:45
  • I create a dummy "MyFirstApp.properties" file in the project folder, but then the console gives : [2014-04-18 18:46:43 - MyFirstApp] ------------------------------ [2014-04-18 18:46:43 - MyFirstApp] Android Launch! [2014-04-18 18:46:43 - MyFirstApp] adb is running normally. [2014-04-18 18:46:43 - MyFirstApp] Could not find MyFirstApp.apk! – Lorenborn Apr 18 '14 at 15:48
  • Is this also the case for a freshly unzipped Eclipse? – Thorbjørn Ravn Andersen Apr 20 '14 at 09:02
  • Yes, I downloaded the zip file several times and its always the same result. Interestingly, whenever I create an andorid project via terminal, it works perfectly, but creating project from the ADT GUI is problematic – Lorenborn Apr 21 '14 at 08:07

6 Answers6

7

ADT bundle does not work with the Oracle Java 7 SE JDK, failing with an NPE in the Android Application Project wizard.

Here's a workaround that lets you keep Java 7 as the default but run ADT with Java 6 when you have both installed. Bring up $ADT_DIR/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini in an editor. (Eclipse.app is a hidden directory)

Before the -vmargs line, insert these two lines:

-vm

/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java

user3893782
  • 71
  • 1
  • 3
1

For those who experience the same problem, here is how i fixed it: After a couple of try and errors, I found out the problem was about creating an activity in the create project wizard. If you simply deselect the create activity button at the 2nd step of the wizard, it creates the project succesfully. After that, you can add a new activity to your project easily

Lorenborn
  • 71
  • 1
  • 3
0

I solved this issue today.hope it helps you...

In package explorer you will find appcompat_v7 appcompat_v7_2 appcompat_v7_3 etc depending on the number of project you have in workspace.... dont close any of those packages... double click on the package to keep each one of it alive... then the issue is gone... it allows me to create new projects and new activities...

0

I solved this issue following this steps:

  1. Download Eclipse JUNO, not Kepler, in version Java EE.
  2. Install plugin ADT using "Install new Software" in eclipse
  3. Install android-sdk using Brew
  4. Referencing android-sdk folder (example: usr/local/Cellar/android-sdk) in eclipse

It Works for me! Obs: I`m using Mac OS X Mavericks 10.9.3.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
0

Updating $ADT_DIR/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini solved this problem for me as suggested by this answer

P C
  • 1
0

I found a solution for MacOS X which is totally different from above mentioned solutions list. A point need to be considered carefully which is "Java null pointer exception" so somewhere java missing in eclipse when we create a project.

Solution here,

  1. Eclipse -> Preferences (in MacOS X, it may different from windows7 hopefully we could see this preferences on Windows menu) at Menu bar

  2. Go to, Java -> install JREs-> Execution environment.

  3. When you click on Java 1.7, Java 1.6 in right panel, in left pane java sdks 1.7 will shown with check box.
  4. Just checked the check box value and Press the "OK" button.

Then try, hopefully you can create a project without any NPE.