Android crash: "Width and height must be > 0"
Hi!
My Android app keeps crashing on startup, and I can't make it work.
I have set all views' width and height to something static, but i still get this error.
Is there something else I can try?
Thanks!
[TRACE] E/TiUncaughtHandler( 746): (main) [405,405] Sending event: exception on thread: main msg:java.lang.IllegalArgumentException: width and height must be > 0; Titanium 1.7.0,2011/06/06 18:05,4155ee
[TRACE] E/TiUncaughtHandler( 746): java.lang.IllegalArgumentException: width and height must be > 0
[TRACE] E/TiUncaughtHandler( 746): at android.graphics.Bitmap.nativeCreate(Native Method)
[TRACE] E/TiUncaughtHandler( 746): at android.graphics.Bitmap.createBitmap(Bitmap.java:468)
[TRACE] E/TiUncaughtHandler( 746): at android.graphics.Bitmap.createBitmap(Bitmap.java:435)
[TRACE] E/TiUncaughtHandler( 746): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
[TRACE] E/TiUncaughtHandler( 746): at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:412)
[TRACE] E/TiUncaughtHandler( 746): at ti.modules.titanium.ui.widget.TiUIImageView.setImage(TiUIImageView.java:589)
[TRACE] E/TiUncaughtHandler( 746): at ti.modules.titanium.ui.widget.TiUIImageView.processProperties(TiUIImageView.java:682)
[TRACE] E/TiUncaughtHandler( 746): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:519)
[TRACE] E/TiUncaughtHandler( 746): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:378)
[TRACE] E/TiUncaughtHandler( 746): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:370)
[TRACE] E/TiUncaughtHandler( 746): at org.appcelerator.titanium.proxy.TiViewProxy.getView(TiViewProxy.java:356)
[TRACE] E/TiUncaughtHandler( 746): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:384)
[TRACE] E/TiUncaughtHandler( 746): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:370)
[TRACE] E/TiUncaughtHandler( 746): at org.appcelerator.titanium.proxy.TiViewProxy.getView(TiViewProxy.java:356)
[TRACE] E/TiUncaughtHandler( 746): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:384)
[TRACE] E/TiUncaughtHandler( 746): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:76)
[TRACE] E/TiUncaughtHandler( 746): at android.os.Handler.dispatchMessage(Handler.java:95)
[TRACE] E/TiUncaughtHandler( 746): at android.os.Looper.loop(Looper.java:123)
[TRACE] E/TiUncaughtHandler( 746): at android.app.ActivityThread.main(ActivityThread.java:4627)
[TRACE] E/TiUncaughtHandler( 746): at java.lang.reflect.Method.invokeNative(Native Method)
[TRACE] E/TiUncaughtHandler( 746): at java.lang.reflect.Method.invoke(Method.java:521)
[TRACE] E/TiUncaughtHandler( 746): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
[TRACE] E/TiUncaughtHandler( 746): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
[TRACE] E/TiUncaughtHandler( 746): at dalvik.system.NativeStart.main(Native Method)
[TRACE] E/AndroidRuntime( 746): FATAL EXCEPTION: main
[TRACE] E/AndroidRuntime( 746): java.lang.IllegalArgumentException: width and height must be > 0
[TRACE] E/AndroidRuntime( 746): at android.graphics.Bitmap.nativeCreate(Native Method)
[TRACE] E/AndroidRuntime( 746): at android.graphics.Bitmap.createBitmap(Bitmap.java:468)
[TRACE] E/AndroidRuntime( 746): at android.graphics.Bitmap.createBitmap(Bitmap.java:435)
[TRACE] E/AndroidRuntime( 746): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
[TRACE] E/AndroidRuntime( 746): at org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:412)
[TRACE] E/AndroidRuntime( 746): at ti.modules.titanium.ui.widget.TiUIImageView.setImage(TiUIImageView.java:589)
[TRACE] E/AndroidRuntime( 746): at ti.modules.titanium.ui.widget.TiUIImageView.processProperties(TiUIImageView.java:682)
[TRACE] E/AndroidRuntime( 746): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:519)
[TRACE] E/AndroidRuntime( 746): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:378)
[TRACE] E/AndroidRuntime( 746): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:370)
[TRACE] E/AndroidRuntime( 746): at org.appcelerator.titanium.proxy.TiViewProxy.getView(TiViewProxy.java:356)
[TRACE] E/AndroidRuntime( 746): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:384)
[TRACE] E/AndroidRuntime( 746): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:370)
[TRACE] E/AndroidRuntime( 746): at org.appcelerator.titanium.proxy.TiViewProxy.getView(TiViewProxy.java:356)
[TRACE] E/AndroidRuntime( 746): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:384)
[TRACE] E/AndroidRuntime( 746): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:76)
[TRACE] E/AndroidRuntime( 746): at android.os.Handler.dispatchMessage(Handler.java:95)
[TRACE] E/AndroidRuntime( 746): at android.os.Looper.loop(Looper.java:123)
[TRACE] E/AndroidRuntime( 746): at android.app.ActivityThread.main(ActivityThread.java:4627)
[TRACE] E/AndroidRuntime( 746): at java.lang.reflect.Method.invokeNative(Native Method)
[TRACE] E/AndroidRuntime( 746): at java.lang.reflect.Method.invoke(Method.java:521)
[TRACE] E/AndroidRuntime( 746): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
[TRACE] E/AndroidRuntime( 746): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
[TRACE] E/AndroidRuntime( 746): at dalvik.system.NativeStart.main(Native Method)
1 Answer
-
I tracked down this problem. I seems to be related to displayCaps somehow.