Bug 25897 - Java.Lang.IllegalStateException when using a ScrollView in a StackLayout of a ViewCell
Summary: Java.Lang.IllegalStateException when using a ScrollView in a StackLayout of a...
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: 1.3.4
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-01-09 17:45 UTC by John Miller [MSFT]
Modified: 2015-02-11 10:14 UTC (History)
5 users (show)

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

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:
VERIFIED FIXED

Description John Miller [MSFT] 2015-01-09 17:45:11 UTC
**Overview:**

   The attached (private) sample app crashes on Android. 

**Steps to Reproduce:**

   1. Run the app on an Android API 19 emulator.

**Actual Results:**

>[MonoDroid] Java.Lang.IllegalStateException: Exception of type 'Java.Lang.IllegalStateException' was thrown.
>[MonoDroid] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <IL 0x00011, 0x00047>
>[MonoDroid] at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr,Android.Runtime.JValue[]) [0x00084] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:896
>[MonoDroid] at Android.Views.ViewGroup.AddView (Android.Views.View) [0x00070] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Views.ViewGroup.cs:1764
>[MonoDroid] at Xamarin.Forms.Platform.Android.ScrollViewContainer.set_ChildView (Xamarin.Forms.View) <IL 0x00054, 0x00153>
>[MonoDroid] at Xamarin.Forms.Platform.Android.ScrollViewRenderer.LoadContent () <IL 0x00011, 0x0004f>
>[MonoDroid] at Xamarin.Forms.Platform.Android.ScrollViewRenderer.SetElement (Xamarin.Forms.VisualElement) <IL 0x000ab, 0x003db>
>[MonoDroid] at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement) <IL 0x00022, 0x000ca>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement,Xamarin.Forms.Platform.Android.IVisualElementRenderer,Xamarin.Forms.Platform.Android.RendererPool,bool) <IL 0x00011, 0x0007f>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement,Xamarin.Forms.VisualElement) <IL 0x00116, 0x0054b>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () <IL 0x0000d, 0x00057>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer`1<Xamarin.Forms.View>.SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager) <0x0005b>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer`1<Xamarin.Forms.View>.SetElement (Xamarin.Forms.View) <0x005e7>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer`1<Xamarin.Forms.View>.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement) <0x0012f>
>[MonoDroid] at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement) <IL 0x00022, 0x000ca>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement,Xamarin.Forms.Platform.Android.IVisualElementRenderer,Xamarin.Forms.Platform.Android.RendererPool,bool) <IL 0x00011, 0x0007f>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement,Xamarin.Forms.VisualElement) <IL 0x00116, 0x0054b>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () <IL 0x0000d, 0x00057>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer`1<Xamarin.Forms.View>.SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager) <0x0005b>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer`1<Xamarin.Forms.View>.SetElement (Xamarin.Forms.View) <0x005e7>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer`1<Xamarin.Forms.View>.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement) <0x0012f>
>[MonoDroid] at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement) <IL 0x00022, 0x000ca>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement,Xamarin.Forms.Platform.Android.IVisualElementRenderer,Xamarin.Forms.Platform.Android.RendererPool,bool) <IL 0x00011, 0x0007f>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement,Xamarin.Forms.VisualElement) <IL 0x00116, 0x0054b>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () <IL 0x0000d, 0x00057>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer`1<Xamarin.Forms.View>.SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager) <0x0005b>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer`1<Xamarin.Forms.View>.SetElement (Xamarin.Forms.View) <0x005e7>
>[MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer`1<Xamarin.Forms.View>.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement) <0x0012f>
>[MonoDroid] at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement) <IL 0x00022, 0x000ca>
>[MonoDroid] at Xamarin.Forms.Platform.Android.ViewCellRenderer.GetCellCore (Xamarin.Forms.Cell,Android.Views.View,Android.Views.ViewGroup,Android.Content.Context) <IL 0x00058, 0x0020b>
>[MonoDroid] at Xamarin.Forms.Platform.Android.CellRenderer.GetCell (Xamarin.Forms.Cell,Android.Views.View,Android.Views.ViewGroup,Android.Content.Context) <IL 0x00055, 0x001be>
>[MonoDroid] at Xamarin.Forms.Platform.Android.CellFactory.GetCell (Xamarin.Forms.Cell,Android.Views.View,Android.Views.ViewGroup,Android.Content.Context,Xamarin.Forms.View) <IL 0x00028, 0x000e3>
>[MonoDroid] at Xamarin.Forms.Platform.Android.ListViewAdapter.GetView (int,Android.Views.View,Android.Views.ViewGroup) <IL 0x0009f, 0x0036b>
>[MonoDroid] at Android.Widget.BaseAdapter.n_GetView_ILandroid_view_View_Landroid_view_ViewGroup_ (intptr,intptr,int,intptr,intptr) [0x0001a] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.20-series/ba9bbbdd/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Widget.BaseAdapter.cs:460

**Expected Results:**

   No Crash

**Build Date & Platform:**

   XF 1.3.1
   XA 4.20

**Additional Information:**

   The app does not crash on iOS, and the cells render as coded.
Comment 2 Ram Chandra 2015-01-13 10:30:08 UTC
I have checked this issue and I am also able to reproduce this issue.

When I run the attach sample on emulator (API 19, API 1) I am getting the following exception.

>System.Diagnostics.Debugger.Mono_UnhandledException (ex={Java.Lang.IllegalStateException: Exception of type 'Java.Lang.IllegalStateException' was thrown.

I am getting the same behavior on device.

Screencast: http://www.screencast.com/t/KfdGswFmMaN

Call Stack: https://gist.github.com/RamChBachkheti/23141baca8d1023e9182
Application Output: https://gist.github.com/RamChBachkheti/5ab1ecc9d8074f3b5f25
IDE logs: https://gist.github.com/RamChBachkheti/72b5e090abad929559af
XAP logs: https://gist.github.com/RamChBachkheti/ca2e136e8bd0aca511e9

Environment Info: 

Xamarin.Forms: 1.3.1.6296

=== Xamarin Studio ===

Version 5.7 (build 661)
Installation UUID: 0b7eaebc-a0ed-4b58-81df-91e378cad28c
Runtime:
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Xamarin.Android ===

Version: 4.20.0.28 (Trial Edition)
Android SDK: /Users/Admin_Mac/Desktop/Anddk/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6602)
Build 6A1052c

=== Xamarin.iOS ===

Version: 8.4.0.47 (Business Edition)
Hash: 7244769
Branch: 
Build date: 2014-12-11 14:54:30-0500

=== Xamarin.Mac ===

Version: 1.12.0.0 (Business Edition)

=== Build Information ===

Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 16:31:31-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7

=== Operating System ===

Mac OS X 10.10.2
Darwin Admin-Macs-Mac-mini.local 14.1.0 Darwin Kernel Version 14.1.0
    Thu Nov 13 18:36:56 PST 2014
    root:xnu-2782.10.65~2/RELEASE_X86_64 x86_64
Comment 3 Eric Maupin 2015-02-05 19:38:59 UTC
Should be fixed in 1.3.4-pre1
Comment 4 Ram Chandra 2015-02-11 10:14:52 UTC
I have checked this issue with following builds:

Xamarin.Forms: 1.3.4.6328-pre2
Mac OS X 10.10.0
Xamarin Studio : 5.7.1 (build 17)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Mono 3.12.0 ((detached/a813491)
GTK+ 2.24.23 (Raleigh theme)
Package version: 312000068
Xamarin.Android: 4.20.0.28 (Business Edition)
java version "1.7.0_65"
=== Build Information ===
Release ID: 507010017
Git revision: 0bc7d3550b6b088ac25b08dcf7bbe73bcc8658b3
Build date: 2015-02-03 19:43:29-05
Xamarin addins: f7b7d34419c9ec24501bfa7c658e80a6305613e0

When I deployed the attached sample on API 19 emulator I observed that application is working fine without any error/exception.

Screencast: http://www.screencast.com/t/Zw9LYZ6MJETu

This issue has been fixed. Hence I am closing this issue.