Exception looks like you are trying to use a drawable that exists only in a drawable directory that Android 1.5 decides not to use.
On Dec 22, 9:07 am, greg1x <gre...@yahoo.com> wrote: > Thank you Dianne! > > Now I got it to work from 1.6 to 2.0 on all screen sizes. > Except it doesn't work on 1.5 anymore. minSdkVersion is 3, so it > starts in the 1.5 AVD, but force closes when it tries to load a > reasource. > It worked before from 1.0 to 2.0.1, it only had resolution scaling > issues. I did not implement any 1.6 specific features since then, just > re-created the project from existing source with 1.6 target & > minSdk=3. > > LogCat shows: > > 12-22 14:57:15.044: WARN/dalvikvm(725): threadid=3: thread exiting > with uncaught exception (group=0x4000fe70) > 12-22 14:57:15.044: ERROR/AndroidRuntime(725): Uncaught handler: > thread main exiting due to uncaught exception > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): > android.content.res.Resources$NotFoundException: File res/drawable- > nodpi/brick.png from drawable resource ID #0x7f020005 > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.content.res.Resources.loadDrawable(Resources.java:1641) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.content.res.Resources.getDrawable(Resources.java:535) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > com.g1x.bgame.BGameView$BGameThread.setSurfaceSize(BGameView.java:394) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > com.g1x.bgame.BGameView.surfaceChanged(BGameView.java:1456) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.view.SurfaceView.updateWindow(SurfaceView.java:358) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.view.SurfaceView.dispatchDraw(SurfaceView.java:259) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.view.ViewGroup.drawChild(ViewGroup.java:1484) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.view.ViewGroup.drawChild(ViewGroup.java:1484) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.view.View.draw(View.java:5841) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.widget.FrameLayout.draw(FrameLayout.java:352) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.view.ViewGroup.drawChild(ViewGroup.java:1486) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1228) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.view.View.draw(View.java:5841) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.widget.FrameLayout.draw(FrameLayout.java:352) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > com.android.internal.policy.impl.PhoneWindow$DecorView.draw > (PhoneWindow.java:1847) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.view.ViewRoot.draw(ViewRoot.java:1217) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.view.ViewRoot.performTraversals(ViewRoot.java:1030) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.view.ViewRoot.handleMessage(ViewRoot.java:1482) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.os.Handler.dispatchMessage(Handler.java:99) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.os.Looper.loop(Looper.java:123) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.app.ActivityThread.main(ActivityThread.java:3948) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > java.lang.reflect.Method.invokeNative(Native Method) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > java.lang.reflect.Method.invoke(Method.java:521) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run > (ZygoteInit.java:782) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > dalvik.system.NativeStart.main(Native Method) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): Caused by: > java.lang.IllegalArgumentException: width and height must be > 0 > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.graphics.Bitmap.nativeCreate(Native Method) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.graphics.Bitmap.createBitmap(Bitmap.java:483) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.graphics.Bitmap.createBitmap(Bitmap.java:451) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.graphics.Bitmap.createScaledBitmap(Bitmap.java:359) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:233) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.graphics.drawable.Drawable.createFromResourceStream > (Drawable.java:663) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): at > android.content.res.Resources.loadDrawable(Resources.java:1637) > 12-22 14:57:15.075: ERROR/AndroidRuntime(725): ... 27 more > > Is there anything I can do about it to support 1.5? > > Thank you! > > On Dec 20, 11:17 pm, Dianne Hackborn <hack...@android.com> wrote: > > > Build against 1.6 (or a later version of the platform that has the APIs you > > need), be careful about how you use newer APIs, set the minSdkVersion to 3, > > and make sure your app works on 1.5. > > > Just building against a newer platform doesn't mean it won't work on an > > older one; you just need to be careful about what you do. > > > On Sun, Dec 20, 2009 at 11:08 AM, greg1x <gre...@yahoo.com> wrote: > > > I was planning to support 1.5 too, since it has 27.7% on the platform > > > version pie here: > > > >http://developer.android.com/intl/zh-CN/resources/dashboard/platform-... > > > > So, I have to choose between high resolution on Droid or 27.7% of > > > users? > > > The only way is to build a specific version just because 1.5? > > > > Thank you Lance! > > > > On Dec 20, 2:19 pm, Lance Nanek <lna...@gmail.com> wrote: > > > > The build target in the project properties has to be set to Android > > > > 1.6 or higher to use that. > > > > > On Dec 20, 3:59 am, greg1x <gre...@yahoo.com> wrote: > > > > > > Thank you! > > > > > > I'm trying to specify the screen size support, but I'm getting these > > > > > errors in the manifest: > > > > > > ERROR No resource identifier found for attribute 'anyDensity' in > > > > > package 'android' > > > > > > Here is my manifest: > > > > > > <?xml version="1.0" encoding="utf-8"?> > > > > > <manifest xmlns:android="http://schemas.android.com/apk/res/android" > > > > > package="com.aaaa.bbb" > > > > > android:versionCode="1" > > > > > android:versionName="1.0.0"> > > > > > > <supports-screens > > > > > android:anyDensity="true" /> > > > > > > <application ....> > > > > > .... > > > > > </application> > > > > > </manifest> > > > > > > If i remove versionCode and versionName (or mofify to anything > > > > > higher), nothing changes. > > > > > > What should I change? I haven't read anywhere a specific resource > > > > > qualifier for anyDensity="true". > > > > > > Thank you for your time. > > > > > > On Dec 20, 4:44 am, Lance Nanek <lna...@gmail.com> wrote: > > > > > > > Your application is being run in compatibility mode. You can read > > > > > > about that and how to avoid it here: > > >http://developer.android.com/intl/zh-CN/guide/practices/screens_suppo... > > > > > > > On Dec 19, 8:57 am, greg1x <gre...@yahoo.com> wrote: > > > > > > > > Hi! > > > > > > > > I'm developing a 2D game I started on Android 1.0/1.1. It scales > > > > > > > itself to the actual surface size, so I had nothing to change > > > because > > > > > > > of the newer higher-resolution devices.I have a G1, but I'd like > > > > > > > to > > > > > > > test it on a Droid too, so I've created an AVD with Android 2.0, > > > > > > > WVGA854. I did not check the "Scale display to real size" option, > > > so I > > > > > > > expected that I'll get the real WVGA dimensions on surfaceChanged. > > > > > > > It doesn't happen like this. My application receives strange > > > > > > > width/ > > > > > > > height values on surfaceChanged. > > > > > > > Width is 569. (height is also very low) > > > > > > > Shouldn't it be around 854? > > > > > > > So, my application draws/scales itself to a smaller screen and > > > > > > > then > > > > > > > the emulator seems to stretch the lower resolution surface to 854 > > > > > > > pixels. (not even 854, in Photoshop I measured ~866 instead) > > > > > > > It means that I get an awfully-looking low resolution app on a big > > > > > > > screen. > > > > > > > > How can I avoid this, so my application gets the real screen size > > > on > > > > > > > surfaceChanged? > > > > > > > > Thank you! > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Developers" group. > > > To post to this group, send email to android-developers@googlegroups.com > > > To unsubscribe from this group, send email to > > > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> > > > For more options, visit this group at > > >http://groups.google.com/group/android-developers?hl=en > > > -- > > Dianne Hackborn > > Android framework engineer > > hack...@android.com > > > Note: please don't send private questions to me, as I don't have time to > > provide private support, and so won't reply to such e-mails. All such > > questions should be posted on public forums, where I and others can see and > > answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en