Android打包问题:resources.ap_不存在 [英] Android Packaging Problem: resources.ap_ does not exist

查看:26
本文介绍了Android打包问题:resources.ap_不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在 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.

现在我收到Error生成最终存档:java.io.FileNotFoundException:C:xxxin esources.ap_不存在错误.

我试过干净,但这不起作用.删除并自动重新生成 R.java 也不起作用.

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

我使用 Android 插件在 Netbeans 中运行了相同的代码,它再次显示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'.这是一个小的 png 文件,我在 .xml 文件中重复.

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

这个文件从第一次开始就运行没有任何问题.我将它从 drawable 文件夹中删除,等待错误消息,然后将其添加回来.文件夹名称旁边的红色 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.

这篇关于Android打包问题:resources.ap_不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆