2010-04-28 103 views
0

我得到这个“java.io.FileNotFoundException:res/drawable-nodpi/background.xml”。 但我确实有res文件未找到异常

文件$

ls -la res/drawable-nodpi/background.xml 
-rw-r--r-- 1 michael staff 859 Mar 8 09:28 res/drawable-nodpi/background.xml 


E/AndroidRuntime( 301): Caused by: java.io.FileNotFoundException: res/drawable-nodpi/background.xml 
E/AndroidRuntime( 301):  at android.content.res.AssetManager.openXmlAssetNative(Native Method) 
E/AndroidRuntime( 301):  at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:469) 
E/AndroidRuntime( 301):  at android.content.res.Resources.loadXmlResourceParser(Resources.java:1894) 
+0

我想如果你使用Resources类,你需要把xml放在正确的目录下。你的配置是什么?你有没有看到http://developer.android.com/guide/topics/resources/resources-i18n.html – 2010-04-28 18:12:28

+0

你编译的SDK版本是什么? – 2010-04-28 18:51:52

+0

也可能是导致问题的xml文件中的语法错误。 – stealthcopter 2010-04-28 19:43:35

回答

1

据我所知,drawable-nodpi文件夹是图像的预调整。我建议把它放在drawable文件夹中。

如果这样做没有帮助,请尝试清理项目并查看gen/your_package/R.Java以查看该文件是否确实包含在软件包中。