Bug 27824 - IllegalArgumentException: width and height must be > 0
Summary: IllegalArgumentException: width and height must be > 0
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-03-10 10:59 UTC by d.sturm
Modified: 2015-03-27 15:41 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
sample solution (12.55 KB, application/octet-stream)
2015-03-10 10:59 UTC, d.sturm
Details
Zip Xamarin logs (1.99 MB, application/zip)
2015-03-10 10:59 UTC, d.sturm
Details
Zip Xamarin Log (581.06 KB, application/octet-stream)
2015-03-25 10:01 UTC, asimk
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description d.sturm 2015-03-10 10:59:29 UTC
Created attachment 10244 [details]
sample solution

The included project throws the following exception for me when running on my Nexus 5 with Android 5.0.1, but runs fine on an older tablet with 4.4.

When starting I get the following call stack:

>	0x21 in System.Diagnostics.Debugger.Mono_UnhandledException_internal	C#
 	0x1 in System.Diagnostics.Debugger.Mono_UnhandledException	C#
 	0x26 in object.44c274f5-6faa-422a-b051-d8fb3dcaecbd	C#
 	0x11 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw	C#
 	0x6A in Android.Runtime.JNIEnv.CallStaticObjectMethod at /Users/builder/data/lanes/monodroid-mlion-monodroid-4.21-series/9e05e39f/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:1161,5	C#
 	0x73 in Android.Graphics.Bitmap.CreateBitmap at /Users/builder/data/lanes/monodroid-mlion-monodroid-4.21-series/9e05e39f/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Graphics.Bitmap.cs:621,21	C#
 	0x9 in Xamarin.Forms.Platform.Android.FrameRenderer.FrameDrawable.CreateBitmap	C#
 	0x41 in Xamarin.Forms.Platform.Android.FrameRenderer.FrameDrawable.Draw	C#
 	0x13 in Android.Graphics.Drawables.Drawable.n_Draw_Landroid_graphics_Canvas_ at /Users/builder/data/lanes/monodroid-mlion-monodroid-4.21-series/9e05e39f/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Graphics.Drawables.Drawable.cs:988,4	C#
 	0x17 in object.44c274f5-6faa-422a-b051-d8fb3dcaecbd	C#

looking at the this.SourceException in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw gives the following (not great formatted, there's probably a better way to get this info):

{Java.Lang.IllegalArgumentException: Exception of type 'Java.Lang.IllegalArgumentException' was thrown.at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <IL 0x00011, 0x00068>at Android.Runtime.JNIEnv.CallStaticObjectMethod (intptr,intptr,Android.Runtime.JValue[]) [0x00064] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.21-series/9e05e39f/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:1161at Android.Graphics.Bitmap.CreateBitmap (int,int,Android.Graphics.Bitmap/Config) [0x0002d] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.21-series/9e05e39f/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Graphics.Bitmap.cs:621at Xamarin.Forms.Platform.Android.FrameRenderer/FrameDrawable.CreateBitmap (bool,int,int) <IL 0x00009, 0x000af>at Xamarin.Forms.Platform.Android.FrameRenderer/FrameDrawable.Draw (Android.Graphics.Canvas) <IL 0x00041, 0x00203>at Android.Graphics.Drawables.Drawable.n_Draw_Landroid_graphics_Canvas_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.21-series/9e05e39f/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Graphics.Drawables.Drawable.cs:988at (wrapper dynamic-method) object.0ea70bba-8ecb-43ff-aec6-bbb2d6e7c1eb (intptr,intptr,intptr) <IL 0x00017, 0x00043>  --- End of managed exception stack trace ---java.lang.IllegalArgumentException: width and height must be > 0	at android.graphics.Bitmap.createBitmap(Bitmap.java:815)	at android.graphics.Bitmap.createBitmap(Bitmap.java:794)	at android.graphics.Bitmap.createBitmap(Bitmap.java:761)	at xamarin.forms.platform.android.FrameRenderer_FrameDrawable.n_draw(Native Method)	at xamarin.forms.platform.android.FrameRenderer_FrameDrawable.draw(FrameRenderer_FrameDrawable.java:49)	at android.view.View.getDrawableRenderNode(View.java:15388)	at android.view.View.drawBackground(View.java:15339)	at android.view.View.draw(View.java:15105)	at android.view.View.updateDisplayListIfDirty(View.java:14048)	at android.view.View.getDisplayList(View.java:14071)	at android.view.View.draw(View.java:14838)	at android.view.ViewGroup.drawChild(ViewGroup.java:3404)	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)	at android.view.View.updateDisplayListIfDirty(View.java:14043)	at android.view.View.getDisplayList(View.java:14071)	at android.view.View.draw(View.java:14838)	at android.view.ViewGroup.drawChild(ViewGroup.java:3404)	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)	at android.view.View.updateDisplayListIfDirty(View.java:14043)	at android.view.View.getDisplayList(View.java:14071)	at android.view.View.draw(View.java:14838)	at android.view.ViewGroup.drawChild(ViewGroup.java:3404)	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)	at android.view.View.updateDisplayListIfDirty(View.java:14043)	at android.view.View.getDisplayList(View.java:14071)	at android.view.View.draw(View.java:14838)	at android.view.ViewGroup.drawChild(ViewGroup.java:3404)	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)	at android.view.View.draw(View.java:15117)	at android.view.View.updateDisplayListIfDirty(View.java:14048)	at android.view.View.getDisplayList(View.java:14071)	at android.view.View.draw(View.java:14838)	at android.view.ViewGroup.drawChild(ViewGroup.java:3404)	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)	at android.view.View.updateDisplayListIfDirty(View.java:14043)	at android.view.View.getDisplayList(View.java:14071)	at android.view.View.draw(View.java:14838)	at android.view.ViewGroup.drawChild(ViewGroup.java:3404)	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)	at android.view.View.draw(View.java:15117)	at android.view.View.updateDisplayListIfDirty(View.java:14048)	at android.view.View.getDisplayList(View.java:14071)	at android.view.View.draw(View.java:14838)	at android.view.ViewGroup.drawChild(ViewGroup.java:3404)	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)	at android.view.View.updateDisplayListIfDirty(View.java:14043)	at android.view.View.getDisplayList(View.java:14071)	at android.view.View.draw(View.java:14838)	at android.view.ViewGroup.drawChild(ViewGroup.java:3404)	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)	at android.view.View.updateDisplayListIfDirty(View.java:14043)	at android.view.View.getDisplayList(View.java:14071)	at android.view.View.draw(View.java:14838)	at android.view.ViewGroup.drawChild(ViewGroup.java:3404)	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)	at android.view.View.updateDisplayListIfDirty(View.java:14043)	at android.view.View.getDisplayList(View.java:14071)	at android.view.View.draw(View.java:14838)	at android.view.ViewGroup.drawChild(ViewGroup.java:3404)	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)	at android.view.View.updateDisplayListIfDirty(View.java:14043)	at android.view.View.getDisplayList(View.java:14071)	at android.view.View.draw(View.java:14838)	at android.view.ViewGroup.drawChild(ViewGroup.java:3404)	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)	at android.view.View.updateDisplayListIfDirty(View.java:14043)	at android.view.View.getDisplayList(View.java:14071)	at android.view.View.draw(View.java:14838)	at android.view.ViewGroup.drawChild(ViewGroup.java:3404)	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)	at android.view.View.draw(View.java:15117)	at android.widget.FrameLayout.draw(FrameLayout.java:592)	at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2595)	at android.view.View.updateDisplayListIfDirty(View.java:14048)	at android.view.View.getDisplayList(View.java:14071)	at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:266)	at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:272)	at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:311)	at android.view.ViewRootImpl.draw(ViewRootImpl.java:2492)	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2337)	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1968)	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1054)	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5779)	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)	at android.view.Choreographer.doCallbacks(Choreographer.java:580)	at android.view.Choreographer.doFrame(Choreographer.java:550)	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)	at android.os.Handler.handleCallback(Handler.java:739)	at android.os.Handler.dispatchMessage(Handler.java:95)	at android.os.Looper.loop(Looper.java:135)	at android.app.ActivityThread.main(ActivityThread.java:5221)	at java.lang.reflect.Method.invoke(Native Method)	at java.lang.reflect.Method.invoke(Method.java:372)	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)}


Visual Studio Environment Info:
Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.53349

Installed Version: Professional

LightSwitch for Visual Studio 2013   06177-004-0446025-02501
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06177-004-0446025-02501
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06177-004-0446025-02501
Microsoft Visual Basic 2013

Visual C# 2013   06177-004-0446025-02501
Microsoft Visual C# 2013

Visual C++ 2013   06177-004-0446025-02501
Microsoft Visual C++ 2013

Visual F# 2013   06177-004-0446025-02501
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06177-004-0446025-02501
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU   06177-004-0446025-02501
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   12.4.51016.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Websites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.21010.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.3
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JetBrains ReSharper 8.2.1   C# Edition build 8.2.1000.4556 on 2014-05-19T10:12:38
JetBrains ReSharper 8.2.1 package for Microsoft Visual Studio. For more information about ReSharper, visit http://www.jetbrains.com/resharper/. Copyright © 2003–2015 JetBrains, Inc.

Microsoft Azure Mobile Services Tools   1.3
Microsoft Azure Mobile Services Tools

NuGet Package Manager   2.8.50926.663
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2013 ENU   12.0.30626
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PowerShell Tools   1.3
Provides file classification services using PowerShell

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   12.0.41012.0
Microsoft SQL Server Data Tools

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.9.347.0 (056cf9e)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.20.0.37 (9e05e39f02bafe8fc0b7ab025d99f3b446835ad4)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.6.3.0 (90e32d01b5960ef8487d3b0a865cb3301dfd95f4)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified
Comment 1 d.sturm 2015-03-10 10:59:56 UTC
Created attachment 10245 [details]
Zip Xamarin logs
Comment 2 asimk 2015-03-25 10:01:11 UTC
Created attachment 10496 [details]
Zip Xamarin Log

I have checked this issue with the sample app attached in Bug description and able to reproduce this issue. I observed that when I deploy attached app on device its throwing "UnhandledException" error. I am getting same exception with android version 5.0.1(Nexus 5) and 5.0(Moto X) both.

Screencast: http://www.screencast.com/t/zxvLzghWMPqX
Device Log: https://gist.github.com/saurabh360/9d17b64fa12bce739d4a
Application output: https://gist.github.com/saurabh360/00e2e2d67d8272bb4d9c

Environment Info:
Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Professional

Xamarin   3.9.534.0 (bb0518b)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.20.0.38 (38ac51a9d0866c7726a7484d82632c82c8221594)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.8.1.0 (61fa2c6e0f2ef51eb98b8810de13b4469f379cc7)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified
Comment 3 Eric Maupin 2015-03-27 15:41:00 UTC
This should be fixed in 1.4.2-pre1