8

I have recently updated my app to a build tarket of SDK version 8 in order to include the App2SD feature for my users.

However I have had reports of devices on SDK 3 (1.5) having problems starting the application, with the following stack trace:

...
E/AndroidRuntime(10638): Caused by: android.content.res.Resources$NotFoundException: File      res/drawable/title_bar_shadow.9.png from drawable resource ID #0x7f020000
E/AndroidRuntime(10638): at android.content.res.Resources.loadDrawable(Resources.java:1641)
E/AndroidRuntime(10638): at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
E/AndroidRuntime(10638): at android.view.View.<init>(View.java:1726)
E/AndroidRuntime(10638): at android.view.View.<init>(View.java:1675)
E/AndroidRuntime(10638): at android.view.ViewGroup.<init>(ViewGroup.java:271)
E/AndroidRuntime(10638): at android.widget.LinearLayout.<init>(LinearLayout.java:92)
E/AndroidRuntime(10638): ... 26 more
E/AndroidRuntime(10638): Caused by: java.io.FileNotFoundException: res/drawable/title_bar_shadow.9.png
E/AndroidRuntime(10638): at android.content.res.AssetManager.openNonAssetNative(Native Method)
E/AndroidRuntime(10638): at android.content.res.AssetManager.openNonAsset(AssetManager.java:392)
E/AndroidRuntime(10638): at android.content.res.Resources.loadDrawable(Resources.java:1634)
E/AndroidRuntime(10638): ... 31 more

If i change the build target back to version 4 as it was previously this issue goes away, also if i remove any graphical resources from my XML files this issue goes away!

Any help would be much appreciated as i currently have a broken app on the market for many users.

BryanH
  • 5,826
  • 3
  • 34
  • 47
Tom
  • 1,191
  • 1
  • 13
  • 24
  • 5
    It is probably worth noting that as this thread: http://groups.google.com/group/android-developers/browse_thread/thread/2f10922ac233c6df/5f67d345da4f0ccc?show_docid=5f67d345da4f0ccc The stack trace isn't much use apart from the fact that it is somehow related to Android not being able to find the correct resources? – Tom May 27 '10 at 18:33
  • 1
    Did you try what the guy said in that thread? It seems to be the same issue – HXCaine May 27 '10 at 18:57

2 Answers2

13

This might be related to different image densities and how SDK 1.5 cant handle that out of the box. Take a look here and here.

Community
  • 1
  • 1
omermuhammed
  • 7,365
  • 4
  • 27
  • 40
  • 3
    You were correct, moving all my medium density assets from drawable-mdpi to just drawable got it working on all platforms. I have also kept a high quality version in hdpi. – Tom May 29 '10 at 10:44
  • 1
    yes, i had the same issue, and i moved all my resources in mdpi folder to drawable folder... working fine now :) thanks – amithgc Aug 29 '10 at 13:28
2

You should be able to do minSdk=3 targetSdk=8 and build against the 2.2 libraries it should work. You just cannot use any of the sdk api that isn't part of the 1.5 api. You will also have to manually install the app to the 1.5 emulator to test it but it should work.

Robby Pond
  • 73,164
  • 16
  • 126
  • 119