Unparsed Aapt Error

江枫思渺然 提交于 2020-01-01 09:29:08

问题


I was trying to build my android application after adding an image, that i planned on using, to the drawables folder. The project worked perfectly fine before, but after running the project, an error message showed up saying, Unparsed Aapt Error. The error shows up on the src folder. I have tried to Clean my project but the R.java class just disapears.

Any suggestions on how to fix this problem????


回答1:


1) clean project

2) close project

3) try again, if still fails: repeat 1 & 2 and then:

4) exit Eclipse and re-enter.

5) set the target in the run configuration to manual and try

There is a bug filed for this error - http://code.google.com/p/android/issues/detail?id=14607

Till its resolved we need to bear with the issue.




回答2:


I found another "fix" for this issue in the Android Developer's Google Group that explains that sometimes the error has been resolved but eclipse is simply unaware of it.

Apparently in this case you can also simply delete the error by right clicking it.




回答3:


Right click on your project > properties > android > in project build target : select android 5.0 with API level 21 or select the same android version with api level which is set in android-support-v7-appcompat project.

The api level and android version should be same in android-support-v7-appcompat as well as in your project.




回答4:


Reason: Android SDK or Platform SDK are not consistent with Eclipse plugin.

Solution:

  1. Open Android SDK Manager and update: Android SDK & Android Platform SDK
  2. Open Eclipse and update plugin



回答5:


I tried all these steps and nothing was fixing the appt error 138 that I was getting. As it happens, I was using TFS plugin at work and at some point the encoding of one of the xml file was changed from 0 on the server to ASCII on the local copy. I had to rollback to the last change set before the problem and then make sure to overwrite the offending file with the version from the server with encoding 0 to fix the problem.




回答6:


In most cases changing the image file qualifier from PNG's to png's will fix the Android "Unparsed aapt error(s)"




回答7:


Actually the problem arises when we paste the image in drawable folder. The image name must contain only [a-z0-9_.] letters. I mean file names anywhere in "res" must only contain lowercase letters, numbers, or underscores. The link https://teamtreehouse.com/forum/beginners-android-app-help explains it very well.



来源:https://stackoverflow.com/questions/6766830/unparsed-aapt-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!