可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I am facing a problem when I try to create new android project in eclipse adt plugin tools.
ERROR/EXCEPTION::
Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'test'.
java.lang.NullPointerException
I have faced this problem two times previously. Only solution was to re-install Windows operating system which actually did solve the problem. But I want a real solution without re-installing Windows.
回答1:
Switching to a new workspace worked for me.
File-> Switch Workspace.
回答2:
found a better solution. in the create project wizard. don't create an activity in the wizard. just untick create an activity and just create the activity manually in the manifest.
回答3:
I guess you upgrade your java to java7u55.
because I am using mac, but, FYI
I solve this by edit eclipse.ini, force the ide to use java 1.6
-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java
you could try the same.
回答4:
In my case, the error was solved by changing the workspace folder permissions with chmod 777.
I am using Mac OS X and downloaded the ADT bundle for Mac.
回答5:
If you close eclipse and then look in your system processes and still see adb running, then that's the problem - it crashed. In my case it was because I have extension files for other programs in my JRE that the adb doesn't seem to like. Remove all your ext files, force shut down your adb.exe and then restart eclipse.
Root exception:
java.lang.NoClassDefFoundError: org/apache/log4j/Priority
回答6:
Usually this means that they have one more time introduced a bug.
The "magic passes" that may help or not help are:
- Pressing F5 (refresh)
- Updating Android, Eclipse and ADT (knowing that you do have such a problem, I myself definitely will not do any such updates in the near future)
- Creating a project from the command line, building it and trying to import
- If you have any project that already works, you may try to take files from that project.
- Read the logs, they are usually more informative than just the last 30 lines, but on Windows you will have to either configure the screen buffer height to be about 300-600, or redirect the output to a file.
- Clean and build again.
回答7:
You usually get this after an SDK/ADT update.
Go to your SDK manager and ensure that there are no updates. Then in Eclipse go to Help > Check for Updates and install any updates it finds.
Restart eclipse and hopefully it should all work.
Failing that uninstall Eclipse and re-install Eclipse and the plugins again should fix it as well, no need to re-install your whole PC.
回答8:
I use maven to build and integrate android projects with jenkins/netbeans. For editing android resources, I often use Eclipse because of the ADT plugin and better android resources support.
Eclipse (Kepler) has serious problems when you import maven-based android projects. It expects the project.properties file in the root folder and will NOT generate it on its own no matter what. Example content:
# this file is needed by eclipse (adt plugin).
# Project target.
target=Google Inc.:Google APIs x86:19
Additionally, create a sym link called "gen" pointing to target/generated-sources/r if using maven to build the android project on the command line. That way, you should be able to do "File->Import...->Existing Android Project". You get an error message, but it didn't matter in my case.
Additional hints in case you have problems with m2e-android plugin:
- always check that the output folders for source dirs and resource dirs are correct.
- check that source dirs are set as source dirs (you usually get a corresponding warning)
- if resources from dependencies are not included in the final apk, check the filter settings for your resource dirs
- you may need to "import maven project from existing sources" before importing it as android project from existing sources.
- make sure dependencies are imported into the workspace and open and referenced (project props -> android -> add lib)
- eclipse adt does not support aar libs, use apklib instead
回答9:
It can happen if you are changing the location of files that your
eclipse project uses.
In that case you can copy the files directly to your resources folder inside the workspace instead of linking them with "import"
回答10:
These simple steps put me out of this trouble -
- In Eclipse, Help menu -> Check for Updates.
- Select all Android related plugins.
- Click Next, Accept the agreement page then proceed to install the
plugin.
回答11:
Make sure your java path points to the java SDK bin directory.. make sure you have installed the latest JDK t be safe..
回答12:
You can also try one of these:
- Close and open the project in Eclipse
- Click right on the project and choose: Android Tools -> Fix Project Properties
回答13:
I beat my head against a wall for a day because of the same problem. My solution (OS X): I had a stale "java_home" definition in my profile pointing to a dead symlink, as well as old classes in /Library/Java/Extensions. I removed the definition and symlink, along with two classes in Extensions (ActiveMQ and Geronimo, FWIW) and the problem went away. Not sure which step was the actual "rectifier" but if any of those conditions apply, you might want to check them.
回答14:
I faced same problem on my New Macbook Pro so I just Downloaded JDK and installed it and problem fixed.
回答15:
I was experiencing the same issue - I refreshed and updated Eclipse and Android plugins and was still seeing the NPE. What worked for me was changing the order of operations.
In order:
1. update Eclipse & Android plugins
2. after the update has completed, perform the F5 Refresh in the current workspace
回答16:
Make a copy of your project in Explorer/Finder. Delete the project in ADT/Eclipse. Import the project again using Eclipse. Project/Clean then build. This works for me.
回答17:
I have tried every solution I found on the web and they did not work.Then I remember java version on my Mac was 1.7 and I have installed subversion version 1.6 and the problem occured after that installation.Also I have deleted eclipse and used a clean eclipse and Android sdk installation I still got the problem, then I uninstalled the JDK 7 as it is told in here http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html and my problem is solved.
回答18:
I have several projects in my folder. Every time I start a new one I close the others. I got this error because appcompat_v7 was closed.
- Right click on
appcompat_v7
and select Open Project.
This solved my problem.
回答19:
Solved after changing a setting in eclipse.ini
. I am using OS X 10.11.4
and Eclipse Mars 4.5.2
.
- Go to the folder of
Eclipse.app
in Finder.
- Right click to open a menu, and click
Show Package Contents
.
- Go to
/Contents/Eclipse
.
- Open
eclipse.ini
in your favorite text editor.
change -vm path like below:
BEFORE: /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/bin
AFTER: /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/jre/bin
reopen Eclipse.
- enjoy :D