android.content.res.Resources$NotFoundException

        

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.


牛牛牛

你可能感兴趣的:(exception,xml,image,File,layout,application)