user2414671
user2414671

Reputation: 51

What can I do to fix a Android SDK Null Pointer Exception error?

I am having a problem creating my first Android App.

  1. I installed JDK 7u21.
  2. I downloaded and extracted Android SDK Build: v22.0.0-675183.
  3. I started Eclipse and created a new Android Application Project.
  4. When I click Finish I get the following error:

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

I have search and couldn't find anyone with the same problem. Did I install something wrong? Is something missing from the SDK? What can I do to correct this error?

Upvotes: 5

Views: 11206

Answers (5)

David Lee
David Lee

Reputation: 3

This works for me:

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. Then you can add an activity to your project easily.

Source: https://code.google.com/p/android/issues/detail?id=68755

Upvotes: 0

Meir Gerenstadt
Meir Gerenstadt

Reputation: 3593

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

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. Before the -vmargs line, insert these two lines:

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

or any place your java is installed, for example on my computer:

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java

Android issue tracker - answer

Upvotes: 0

Jithin
Jithin

Reputation: 77

I've run into the same problem. Every new project, imported or otherwise throws that exception.

It appears to be a bug with Eclipse, and the simplest fix for me was to re-extract the ADT bundle, and replace only the eclipse directory. It'll take forever to download the SDKs if you replace the SDK directory too.

Upvotes: 0

anbuf
anbuf

Reputation: 91

In my case I switch from Android SDK 64 bits, to Android SDK 32 bits. Now it's working perfectly.

Upvotes: 1

Jan Ni
Jan Ni

Reputation: 11

Have the same problem after updating SDK to 22. For me, it seems to be a backward compatibility fail by Android vs. Eclipse (on my side additional with Maven). See also: Eclipse Upgrade Not Working

So not your fault. Try f.e. IntelliJ for the moment. There is also a specialised version, called Android Studio but this is not that stable as the original.

The Android guys also deliver a complete package for Eclipse + ADT-Plugin, but not sure, whether this solves the problem.

Upvotes: 0

Related Questions