Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
458 views
in Technique[技术] by (71.8m points)

eclipse - Android Packaging Problem: resources.ap_ does not exist

I am trying to fix a problem in Eclipse for like 3 hours and I haven't made any progress. Tomorrow is the customer coming to look at my app, and I have no time left. This is really frustrating!

This morning when I was coding and I wanted to run my app on my device Eclipse crashed all of a sudden. 'aapt.exe has stopped working'

After this Eclipse wasn't starting anymore. It froze at the splash image.

I looked on the internet and tried different solutions like going back to Java SE 6 update 20, changing .ini file etc. in the end reinstalling Eclipse did the job.

Shortly after that the 'aapt.exe has stopped working' returned. I found a solution by changing my projects target. 1.5, 1.6, 2.2 doesn't matter, as long as it's different than the one before.

Now I get the Error generating final archive: java.io.FileNotFoundException: C:xxxin esources.ap_ does not exist error.

I tried clean but that doesn't work. Deleting and automatically regenarting R.java also didn't work.

I ran the same code in Netbeans with the Android plugin and there it gives me the 'aapt.exe has stopped working' again :(

Please guys, how can I fix this?

Edit:

I think I may have found the reason. These are the error lines in the console:

org.xmlpull.v1.XmlPullParserException: Binary XML file line #3: <bitmap> requires a valid src attribute
at android.graphics.drawable.BitmapDrawable.inflate(BitmapDrawable.java:341)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:779)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:720)
at com.android.layoutlib.bridge.ResourceHelper.getDrawable(ResourceHelper.java:150)
at com.android.layoutlib.bridge.BridgeTypedArray.getDrawable(BridgeTypedArray.java:668)
at android.view.View.<init>(View.java:1846)
at android.view.View.<init>(View.java:1795)
at android.view.ViewGroup.<init>(ViewGroup.java:282)    
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
[2011-01-17 16:37:20 - gegevens.xml] Unable to resolve drawable "com.android.layoutlib.utils.ResourceValue@267e33de" in attribute "background"

The file it's talking about is 'bg.png'. It's a small png file which I repeat in a .xml file.

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/bg" android:tileMode="repeat" />

This file has worked from the first time without any problems. I deleted it from the drawable folder, waited for an error message, and then added it back. The red x next to the foldername got away, but still nothing different...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

A shot in the dark, but if it's just the one PNG file could you delete it from the project and add it back? There must be something breaking the resources file.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...