Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android untrue resource not found exception

I am not a new developer to android. I have an application on the market. However, sometimes I get reported strange exceptions to have occured:

java.io.FileNotFoundException: res/drawable-mdpi/background.png

 android.content.res.Resources$NotFoundException: File res/drawable-mdpi/background.png from drawable resource ID #0x7f02001f

This is by all means untrue because otherwise I wouldn;t have compiled or run the program myself. Also I am sure the resources are there. This is just one of the exception I have been reported. There are same exceptions for other resources mainly layouts.

So my question is how would this happen? Is it because the android system has failed installing correctly my app? I almost sure this must be the case because I have many users who use it without problem.

Please help regarding this.

like image 865
Norbert Avatar asked Jan 20 '12 07:01

Norbert


3 Answers

There can be several possible reasons:

  1. Moving application to SD card.

  2. There was some problem in downloading or installing APK from market (file can be corrupted).

  3. User get APK with corrupted file from other source (for example via bluetooth from other user)

  4. Some system bug (from software, to brocken hardware)

Any way You can't do anything with this problem.

like image 110
Jin35 Avatar answered Nov 15 '22 00:11

Jin35


Could it be that the application was pushed to SD Card and something happens to the drawable while on SD. I saw similar issues with layouts rather drawable and it was because the application was pushed to SD.

like image 29
charroch Avatar answered Nov 14 '22 22:11

charroch


Maybe you have included certain codes that reference content from Android SDK.

In my case, I faced similar issue and when I removed the line

android:background="?android:attr/actionBarItemBackground"

from my xml, everything works fine again.

like image 1
Neoh Avatar answered Nov 14 '22 23:11

Neoh