Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1056023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:39:18+00:00 2026-05-16T17:39:18+00:00

I’m trying to backport an android 1.6+ application to android 1.5. Following the advice

  • 0

I’m trying to backport an android 1.6+ application to android 1.5.

Following the advice here:

  • http://comments.gmane.org/gmane.comp.handhelds.android.devel/97051
  • http://groups.google.com/group/android-developers/browse_thread/thread/ff22f6e42a4a46d2/4201a20aaa23069d
  • Android 2.2 SDK breaks compatibility with older phones
  • https://developer.android.com/guide/topics/resources/providing-resources.html#ScreenCompatibility

… I have done the following:

  1. Modify AndroidManifest.xml to set minSdkVersion to 3
  2. Move all of my files that were previously in drawable-mdpi/ to drawable/
  3. Rename drawable-hdpi/ to drawable-hdpi-v4/

It seems to me that this should ensure that 1.5 devices use the files in drawable/ while 1.6 and later devices use the files in drawable/ and drawable-hdpi-v4/ as appropriate. The drawable/ and drawable-hdpi-v4/ directories are the only drawable directories in my res folder.

However, after I compile, install, and run the resulting binary on the 1.5 emulator, I get the following error:

E/AndroidRuntime( 1096): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 1096):    at android.widget.ImageView.<init>(ImageView.java:103)
E/AndroidRuntime( 1096):    at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime( 1096):    at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
E/AndroidRuntime( 1096):    at android.view.LayoutInflater.createView(LayoutInflater.java:499)
E/AndroidRuntime( 1096):    ... 26 more
E/AndroidRuntime( 1096): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/bg.png from drawable resource ID #0x7f02002e
E/AndroidRuntime( 1096):    at android.content.res.Resources.loadDrawable(Resources.java:1641)
E/AndroidRuntime( 1096):    at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
E/AndroidRuntime( 1096):    at android.widget.ImageView.<init>(ImageView.java:113)
E/AndroidRuntime( 1096):    ... 30 more
E/AndroidRuntime( 1096): Caused by: java.io.FileNotFoundException: res/drawable/bg.png
E/AndroidRuntime( 1096):    at android.content.res.AssetManager.openNonAssetNative(Native Method)
E/AndroidRuntime( 1096):    at android.content.res.AssetManager.openNonAsset(AssetManager.java:392)
E/AndroidRuntime( 1096):    at android.content.res.Resources.loadDrawable(Resources.java:1634)
E/AndroidRuntime( 1096):    ... 32 more

For reasons I don’t understand, 1.5 devices are not able to see the bg.png image file, a version of which is in both the drawable/ and drawable-hdpi-v4/ directories.

Running the same binary works fine on 1.6.

Why won’t 1.5 devices see my res/drawable/bg.png image with this setup?

UPDATE: As described in Providing screen resource compatibility for Android 1.5, I’m using Android SDK r6 and have put my mdpi resources in the drawable/ directory. Also, I’ve verified that the problem isn’t isolated to bg.png. If I remove the reference to the broken drawable in my xml, the app breaks on the next and each subsequent graphic during setContentView().

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:39:18+00:00Added an answer on May 16, 2026 at 5:39 pm

    Success!!!

    The problem was that I had one foo.png resource in drawable-hdpi-v4/ that was not present in the drawable/ directory. When I referenced R.drawable.foo from my layout file, the 1.5 emulator was therefore not able to find a suitable resource for that id. What made it so difficult to track down was that the error didn’t happen immediately when referencing foo.png, but rather the error was thrown on the NEXT resource referenced, which was bg.png. Google has confirmed this is a bug.

    Adding an mdpi version of foo.png to the drawable/ directory fixed the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.