简体   繁体   中英

Eclipse ADT 22.6.2 still gives the error “java.lang.NullPointerException”

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

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

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

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...

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.

更新$ ADT_DIR / eclipse / Eclipse.app / Contents / MacOS / eclipse.ini为我解决了这个问题,正如这个答案所建议的那样

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM