android.content.res.Resources$NotFoundException 电玩女神 2022-10-01 03:49 95阅读 0赞 # E/AndroidRuntime( 1046): java.lang.RuntimeException: Unable to start activity ComponentInfo\{com.example.hellomapview/com.example.hellomapview.HelloMapActivity\}: android.content.res.Resources$NotFoundException: File res/drawable/red.png from xml type layout resource ID \#0x7f020000 # I added a png image to be used as an icon for the application. When debugged andinstalled, the icon appeared fine on the device, but the application wouldn't startand it raised a "resource not found" exception for the image. Deleting the contentsof the gen/ and bin/ directories does solve the problem.I've also experienced this problem when I changed the xml layout files a few timesduring development. The application sometimes raises runtime exceptions about missingwidgets or wrong IDs that are neither missing nor wrong. And again, deleting thecontents or gen/ and bin/ solves the problem.This really needs to be fixed since it drove me crazy to see that my applicationwasn't working and my code was perfectly fine. It took me a while to find this pageand figure out what I should do to fix it. 牛牛牛
还没有评论,来说两句吧...