Android的包装问题:resources.ap_不存在不存在、问题、Android、resources

2023-09-12 06:27:41 作者:笑拥孤独り

我想在Eclipse中解决问题像3小时,我还没有取得任何进展。明天是客户来看看我的应用程序,我也没有留下时间。这是很无奈!

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!

今天早上,当我的编码,我想我的设备的Eclipse坠毁突然上运行我的应用程序。 aapt.exe已停止工作

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'

在此的Eclipse是无法启动了。它冻结在开机画面。

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

我看着在互联网上,尝试了不同的解决方案,好像又回到了Java SE 6的更新20,更改.ini文件等中端重新安装Eclipse中做的工作。

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.

在这之后不久的aapt.exe已停止工作返回。我发现了一个解决方案,通过改变我的项目目标。 1.5,1.6,2.2也没有关系,只要它比前一个不同

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.

现在我得到的错误产生最终的归档文件:java.io.FileNotFoundException:C:\ XXX \斌\ resources.ap_不存在错误

我试图干净,但不起作用。删除和自动regenarting R.java也没有工作。

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

我跑同样的code在Netbeans中的Andr​​oid插件,还有它给我的'aapt.exe已停止工作再次:(

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?

编辑:

我觉得我的可以已经找到了原因。这些都是在控制台中的错误行:

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"

它谈论的文件是'bg.png。这是我重复在一个.xml文件小PNG文件。

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" />

该文件已经从第一次工作没有任何问题。 我从绘制文件夹删除了,等了一个错误信息,然后将其添加回来。红色的X旁边的文件夹名逃走了,但仍然没有什么不同...

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

推荐答案

在黑暗中拍摄,但如果你能不能从项目中删除,并添加它只是一个PNG文件?一定有什么突破资源文件。

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.