Tried my app with 2.3.5 pre-5 again. Now it launches but adding a complex control to an absolute layout causes an exception, so reverting to 2.3.4.
The code that causes this exception is "layout.Children.Add(popup);"
I am hoping this exception will be enough to track this down (I don't have time to try to create a sample). I really want to try fast renderers!
{System.NullReferenceException: Object reference not set to an instance of an object. at Xamarin.Forms.Platform.Android.ButtonRenderer.UpdateBackgroundColor () [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\MasterDetailRenderer.cs:47 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetElement (TElement element) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\ImageRenderer.cs:80
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00019] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\VisualElementRenderer.cs:43 at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0000d] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EntryRenderer.cs:25 at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x0001f] in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x0003b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:60 at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x0000d] in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) <0x98ee6fa0 + 0x00067> in :0
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetElement (TElement element) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\ImageRenderer.cs:80 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00019] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\VisualElementRenderer.cs:43
at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0000d] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EntryRenderer.cs:25
at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x0001f] in :0
at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x0003b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:60
at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x0000d] in :0
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) <0x98ee6fa0 + 0x00067> in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetElement (TElement element) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\ImageRenderer.cs:80
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00019] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\VisualElementRenderer.cs:43 at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0000d] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EntryRenderer.cs:25 at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x0001f] in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x0003b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:60 at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x0000d] in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) <0x98ee6fa0 + 0x00067> in :0
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetElement (TElement element) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\ImageRenderer.cs:80 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00019] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\VisualElementRenderer.cs:43
at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0000d] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EntryRenderer.cs:25
at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x0001f] in :0
at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x0003b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:60
at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x0000d] in :0
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) <0x98ee6fa0 + 0x00067> in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].SetElement (TElement element) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\ImageRenderer.cs:80
at Xamarin.Forms.Platform.Android.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00019] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\VisualElementRenderer.cs:43 at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0000d] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EntryRenderer.cs:25 at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x0001f] in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementPackager.OnChildAdded (System.Object sender, Xamarin.Forms.ElementEventArgs e) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:40 at Xamarin.Forms.Element.OnChildAdded (Xamarin.Forms.Element child) [0x00029] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\Element.cs:362 at Xamarin.Forms.VisualElement.OnChildAdded (Xamarin.Forms.Element child) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\VisualElement.cs:578 at Xamarin.Forms.Layout1[T].OnChildAdded (Xamarin.Forms.Element child) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\Layout.cs:32
at Xamarin.Forms.AbsoluteLayout.OnChildAdded (Xamarin.Forms.Element child) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\AbsoluteLayout.cs:67
at Xamarin.Forms.Layout.OnInternalAdded (Xamarin.Forms.View view) [0x0001d] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\Layout.cs:413
at Xamarin.Forms.Layout.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00089] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\Layout.cs:403
at (wrapper delegate-invoke) :invoke_void_object_NotifyCollectionChangedEventArgs (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
at System.Collections.ObjectModel.ObservableCollection1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in <a547bd0d78184f26ab08d022f013c1e1>:0 at System.Collections.ObjectModel.ObservableCollection1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in :0
at System.Collections.ObjectModel.ObservableCollection1[T].InsertItem (System.Int32 index, T item) [0x00024] in <a547bd0d78184f26ab08d022f013c1e1>:0 at System.Collections.ObjectModel.Collection1[T].Add (T item) [0x00020] in <3fd174ff54b146228c505f23cf75ce71>:0
at Xamarin.Forms.ObservableWrapper2[TTrack,TRestrict].Add (TRestrict item) [0x0004b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\ObservableWrapper.cs:35 at XYZ.PopupLayout..ctor (Xamarin.Forms.AbsoluteLayout root, Xamarin.Forms.View popup, System.Nullable1[T] rectangle, Xamarin.Forms.AbsoluteLayoutFlags layoutFlags, TDSP.PopupLayout+Animation animation, System.Boolean isModal, System.Boolean isModalAutoClose, System.Action executeOnClose, System.Action executeOnCancel) [0x000b9] in C:\z\Phone\Controls\PopupLayout.cs:247 }`
@SamanthaHouts Looks like we need a disposed check on the new Image fastrenderer.
Getting ObjectDisposedExceptions all over the place when using the default Tarjan GC.
@rmarinho what about the MasterDetail issue above? All I did was install the new -pre5 and that happened. Rolling back fixes it. I'm using the Android.Support 25.3.1 packages. I did not upgrade the Android Support packages when trying the new XF -pre5.
@rmarinho Here is my android manifest the android styles I'm using. Let me know if this helps in recreating the issue. If not, I'll give you access to repo and post a bug on BugZilla.
<style name="MyTheme" parent="MyTheme.Base">
<!--If you are using MasterDetailPage you will want to set these, else you can leave them out-->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowTranslucentStatus">true</item>
</style>
Hi, we have found that we pushed the wrong package, was a tag from master not from 2.3.5 branch.. we have pushed aa new pre5 package also with a couple of fixes for the reported issues .. please update the app for 2.3.5.255-pre5
I've just updated to newest 2.3.5.255-pre5 (newer, than previous wrong 2.3.5.253-pre5), and my app is crashing at Android in MainActivity as LoadApplication(new App())
06-27 08:28:31.448 I/MonoDroid( 2181): System.TypeLoadException: Could not resolve type with token 01000072 (from typeref, class/assembly Xamarin.Forms.Platform.Android.EntryEditText, Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null)
06-27 08:28:31.448 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x00050] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\CarouselPageAdapter.cs:50
06-27 08:28:31.448 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0001c] in <b04fa84be1cb4529bae087399c91c815>:0
06-27 08:28:31.448 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00011] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\MasterDetailContainer.cs:122
06-27 08:28:31.448 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\NavigationRenderer.cs:28
06-27 08:28:31.448 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00105] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\NavigationRenderer.cs:113
06-27 08:28:31.448 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\NavigationRenderer.cs:23
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\PageRenderer.cs:46
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x00050] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\CarouselPageAdapter.cs:50
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0001c] in <b04fa84be1cb4529bae087399c91c815>:0
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00011] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\MasterDetailContainer.cs:122
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.ScrollViewContainer.set_ChildView (Xamarin.Forms.View value) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\ButtonDrawable.cs:20
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.ScrollViewRenderer.LoadContent () [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\ListViewAdapter.cs:42
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.ScrollViewRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0007a] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\ImageRenderer.cs:53
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00011] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\MasterDetailContainer.cs:122
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\NavigationRenderer.cs:28
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00105] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\NavigationRenderer.cs:113
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\NavigationRenderer.cs:23
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\PageRenderer.cs:46
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x00050] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\CarouselPageAdapter.cs:50
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0001c] in <b04fa84be1cb4529bae087399c91c815>:0
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00011] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\MasterDetailContainer.cs:122
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.NavigationRenderer.SwitchContentAsync (Xamarin.Forms.Page view, System.Boolean animated, System.Boolean removed) [0x0001b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EntryRenderer.cs:53
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.NavigationRenderer.OnPushAsync (Xamarin.Forms.Page view, System.Boolean animated) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EditorRenderer.cs:134
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.NavigationRenderer.PushViewAsync (Xamarin.Forms.Page page, System.Boolean animated) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EditorRenderer.cs:32
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.NavigationRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1[TElement] e) [0x00039] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EditorRenderer.cs:110
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x00050] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\CarouselPageAdapter.cs:50
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0001c] in <b04fa84be1cb4529bae087399c91c815>:0
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00011] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\MasterDetailContainer.cs:122
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.Platform.AddChild (Xamarin.Forms.VisualElement view, System.Boolean layout) [0x00013] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\ScrollViewContainer.cs:49
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x0000b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\PageContainer.cs:23
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.FormsApplicationActivity.InternalSetPage (Xamarin.Forms.Page page) [0x0002b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:227
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.FormsApplicationActivity.SetMainPage () [0x00006] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:244
06-27 08:28:31.449 I/MonoDroid( 2181): at Xamarin.Forms.Platform.Android.FormsApplicationActivity.LoadApplication (Xamarin.Forms.Application application) [0x0000f] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:81
06-27 08:28:31.449 I/MonoDroid( 2181): at MyProject.Droid.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x0009d] in C:\workspace\MyProject\MyProject\MyProject.Android\MainActivity.cs:42
06-27 08:28:31.449 I/MonoDroid( 2181): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x0000f] in <d855bac285f44dda8a0d8510b679b1e2>:0
06-27 08:28:31.449 I/MonoDroid( 2181): at (wrapper dynamic-method) System.Object:f5dc843d-21ca-4868-9a51-058b0fd17c02 (intptr,intptr,intptr)
@SamanthaHouts said: @Velocity We do already check for Disposed on Image Fast Renderer. Can you give me a stack trace? Thanks!
Thanks Samantha. Please see exception and stack trace below.
Test case is just using an Image inside a ContentView. This is working code in XF 2.33/2.34.
Exception
Cannot access a disposed object.
Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.ImageRenderer'.
at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in :0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in :0
at Android.Views.View.get_Parent () [0x0000a] in :0
at Xamarin.Forms.Platform.Android.ViewExtensions.RemoveFromParent (Android.Views.View view) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\GestureManager.cs:249
at Xamarin.Forms.Platform.Android.VisualElementPackager.RemoveChild (Xamarin.Forms.VisualElement view) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:48
at Xamarin.Forms.Platform.Android.VisualElementPackager.OnChildRemoved (System.Object sender, Xamarin.Forms.ElementEventArgs e) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:42
at Xamarin.Forms.Element.OnChildRemoved (Xamarin.Forms.Element child) [0x0000f] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\Element.cs:374
at Xamarin.Forms.VisualElement.OnChildRemoved (Xamarin.Forms.Element child) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\VisualElement.cs:586
at Xamarin.Forms.Layout.OnInternalRemoved (Xamarin.Forms.View view) [0x00012] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\Layout.cs:424
at Xamarin.Forms.Layout.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0002f] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\Layout.cs:388
at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in :0
at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in :0
at System.Collections.ObjectModel.ObservableCollection`1[T].RemoveItem (System.Int32 index) [0x0002b] in :0
at System.Collections.ObjectModel.Collection`1[T].RemoveAt (System.Int32 index) [0x0002b] in <3fd174ff54b146228c505f23cf75ce71>:0
at Xamarin.Forms.TemplateUtilities.OnContentChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00018] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\TemplateUtilities.cs:63
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00108] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindableObject.cs:596
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindableObject.cs:390
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0005f] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindableObject.cs:543
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindableObject.cs:83
at Xamarin.Forms.ContentView.set_Content (Xamarin.Forms.View value) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\ContentView.cs:11
@SamanthaHouts One last thing we noticed, status bar is solid white on Android.
We are styling it in style.xml. No change, working in XF 2.33/2.34.
--> Update <--
Ignore this, we had a separate "style.xml" in values-v21.
Appears this was being previously ignored, but now is taking effect with XF 2.3.5. Removing it solved the problem.
Further testing of XF 2.3.5.255-pre5 shows more occurrences of ObjectDisposedException with the fast renderers.
These need to be resolved to work along with Tarjan before XF 2.3.5 is released to stable, especially given how Label, Button and Image are fundamental building blocks of most applications.
Exception
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.
Stack Trace
at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in :0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in :0
at Android.Widget.TextView.set_TextFormatted (Java.Lang.ICharSequence value) [0x00029] in :0
at Android.Widget.TextView.set_Text (System.String value) [0x0000d] in :0
at Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer.UpdateText () [0x00084] in :0
at Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x000d0] in :0
@Velocity said:
Further testing of XF 2.3.5.255-pre5 shows more occurrences of ObjectDisposedException with the fast renderers.
These need to be resolved to work along with Tarjan before XF 2.3.5 is released to stable, especially given how Label, Button and Image are fundamental building blocks of most applications.
Exception
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.
Stack Trace
at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in :0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in :0
at Android.Widget.TextView.set_TextFormatted (Java.Lang.ICharSequence value) [0x00029] in :0
at Android.Widget.TextView.set_Text (System.String value) [0x0000d] in :0
at Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer.UpdateText () [0x00084] in :0
at Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x000d0] in :0
Updating to 2.3.5.255-pre5 causes a lot of 'Object reference not set to an instance of an object' errors on my .xaml files when building my project. This did not happen on the stable version.
@Velocity we are trying to figure out exactly how the object is going through the GC and getting the finalizer called on it while it clearly still has roots cable of changing properties on the element. The element holds a reference to the renderer as the renderer is subscribed to events on the Element so it should not be getting GC'd at all. Yet clearly this is what is happening.
We desperately need a boiled down reproduction of this specific crash with LabelRenderer.UpdateText.
> @TheRealJasonSmith said:
> @Velocity we are trying to figure out exactly how the object is going through the GC and getting the finalizer called on it while it clearly still has roots cable of changing properties on the element. The element holds a reference to the renderer as the renderer is subscribed to events on the Element so it should not be getting GC'd at all. Yet clearly this is what is happening.
>
> We desperately need a boiled down reproduction of this specific crash with LabelRenderer.UpdateText.
Thanks @TheRealJasonSmith. We're currently in the middle of a sprint, but have manage to clear aside tomorrow to work on this repro project. We really want to see this ironed out too, so happy to invest some time into it.
I'll update the ticket on Bugzilla once the repro is available. Thanks!
@TheRealJasonSmith Thanks Jason, have updated the Bugzilla ticket.
I don't think this is a blocker, but rather a specific issue related to a native collection view we have had around since XF 2.30.
Tested many different combinations together of vanilla views, nested views, labels and buttons in a view cell etc and was unable to repro. Only got this behaviour when popping pages back and forth with a RecyclerView performing layout. Removing this, I could no longer repro the problem.
2.3.5-pre5 introduced a change which seems to have broken it, but given this is an in-house control we'll make the necessary changes.
Any suggestion would help me after you saw below log and got something in your mind.
[Choreographer] Skipped 36 frames! The application may be doing too much work on its main thread.
[Mono] Assembly Ref addref Refractored.XamForms.PullToRefresh.Droid[0xaf026280] -> Refractored.XamForms.PullToRefresh[0xaf0261c0]: 3
[Mono] Assembly Ref addref ImageCircle.Forms.Plugin.Android[0xaf024fc0] -> ImageCircle.Forms.Plugin.Abstractions[0xaf024a20]: 3
[Mono] The request to load the assembly System.Net.Http v4.0.0.0 was remapped to v2.0.5.0
[Mono] Unloading image System.Net.Http.dll [0x95bb5800].
[Mono] Image addref System.Net.Http[0x96627460] -> System.Net.Http.dll[0x9ae7f600]: 7
[Mono] Config attempting to parse: 'System.Net.Http.dll.config'.
[Mono] Config attempting to parse: '/usr/local/etc/mono/assemblies/System.Net.Http/System.Net.Http.config'.
[Mono] Assembly Ref addref Xamarin.Forms.Platform.Android[0xb337b060] -> System.Net.Http[0xab4cf500]: 5
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md5010ca2fa7c1df37f0a4acf6faa4da136.FixedLineLabelRenderer
[] * Assertion at /Users/builder/jenkins/workspace/xamarin-android/xamarin-android/external/mono/mono/mini/debugger-agent.c:8949, condition `locals->locals [i].index < header->num_locals' not met
[libc] Fatal signal 6 (SIGABRT), code -6 in tid 1895 (Debugger agent)
@Britton_Beckham do you have a reproduction case for that? We are trying to work out how these objects are getting disposed while still having live connections to them. It appears they are having their finalizers run based on some stack traces and we are struggling to envision how. A repro would be hugely helpful.
@TheRealJasonSmith the best I can do is give you guys access to my app. The problem with this exception is that it is not consistent. I could perform the same action 10 times and only get it once or twice. Like @Velocity it happens more on navigation actions (it would seem) than anything else. Sadly, when debugging in VS, I get no context to where the code is when the exception happens, and as you can see from my MobileCenter stack trace, it's not much more helpful there. Would you like access to my code base?
Can you try subclassing the ImageRenderer (fast renderer) and replacing the default with your new custom one. Then override the dispose method and just start doing some tracking there for which things get called with Dispose(true) vs Dispose(false). It is my contention that a Dispose(false) is happening shortly before the crash... If you do find that lets try to figure out why.
Some further testing notes: it is rather difficult to produce a repro project which highlights the DisposedException crashes. However from what we have seen, the best way to increase the chance of seeing them is:
Apply memory pressure, forcing the GC to collect more frequently.
Push and pop pages back and forth onto/from the navigation stack.
E.g. We have a production app which contains a video player. Popping the video page from the stack almost certainly causes an ObjectDisposedException to be thrown. Both the video page and the n-1 page contain Buttons, Images and Labels. However when we remove the video player, the exception is not thrown presumably as a GC cycle hasn't run.
@TheRealJasonSmith Going to try producing a repro project with manual GC invocation.
See my note above. Hopefully this can get things to break! Will report back on this later today.
Related to the crash with ButtonDrawable, but this time an ObjectDisposedException happening in the ProgressBarRenderer. Happens after pushing/popping the nav stack 2-3 times and simultaneously invoking a GC.Collect. Without the GC collect, you won't see it - which seems to confirm our theory on why it has been so difficult to get a decent repro project for this.
The binding is still firing OnElementPropertyChanged after the page has been popped, the control has been disposed and so you get an ObjectDisposedException. We have found this is behaviour is particular noticeable when using bindings and/or with DataTriggers.
Hopefully this example will make it easier to reproduce the other related disposed exceptions.
As a workaround I made a renderer for Button that only makes changes to devices > KitKat.
Its not perfect but it does what I need it to do
Also added a property called IsFlat to get a flat button.
Posts
Tried my app with 2.3.5 pre-5 again. Now it launches but adding a complex control to an absolute layout causes an exception, so reverting to 2.3.4.
The code that causes this exception is "layout.Children.Add(popup);"
I am hoping this exception will be enough to track this down (I don't have time to try to create a sample). I really want to try fast renderers!
{System.NullReferenceException: Object reference not set to an instance of an object. at Xamarin.Forms.Platform.Android.ButtonRenderer.UpdateBackgroundColor () [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\MasterDetailRenderer.cs:47 at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetElement (TElement element) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\ImageRenderer.cs:80at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00019] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\VisualElementRenderer.cs:43 at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0000d] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EntryRenderer.cs:25 at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x0001f] in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x0003b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:60 at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x0000d] in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) <0x98ee6fa0 + 0x00067> in :0at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetElement (TElement element) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\ImageRenderer.cs:80 at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00019] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\VisualElementRenderer.cs:43at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0000d] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EntryRenderer.cs:25
at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x0001f] in :0
at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x0003b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:60
at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x0000d] in :0
at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) <0x98ee6fa0 + 0x00067> in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetElement (TElement element) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\ImageRenderer.cs:80at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00019] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\VisualElementRenderer.cs:43 at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0000d] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EntryRenderer.cs:25 at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x0001f] in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x0003b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:60 at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x0000d] in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) <0x98ee6fa0 + 0x00067> in :0at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetElement (TElement element) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\ImageRenderer.cs:80 at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00019] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\VisualElementRenderer.cs:43at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0000d] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EntryRenderer.cs:25
at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x0001f] in :0
at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x0003b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:60
at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x0000d] in :0
at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) <0x98ee6fa0 + 0x00067> in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].SetElement (TElement element) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\ImageRenderer.cs:80at Xamarin.Forms.Platform.Android.VisualElementRenderer
1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00019] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\VisualElementRenderer.cs:43 at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0000d] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Renderers\EntryRenderer.cs:25 at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x0001f] in <b04fa84be1cb4529bae087399c91c815>:0 at Xamarin.Forms.Platform.Android.VisualElementPackager.OnChildAdded (System.Object sender, Xamarin.Forms.ElementEventArgs e) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\FastRenderers\LabelRenderer.cs:40 at Xamarin.Forms.Element.OnChildAdded (Xamarin.Forms.Element child) [0x00029] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\Element.cs:362 at Xamarin.Forms.VisualElement.OnChildAdded (Xamarin.Forms.Element child) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\VisualElement.cs:578 at Xamarin.Forms.Layout
1[T].OnChildAdded (Xamarin.Forms.Element child) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\Layout.cs:32at Xamarin.Forms.AbsoluteLayout.OnChildAdded (Xamarin.Forms.Element child) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\AbsoluteLayout.cs:67
at Xamarin.Forms.Layout.OnInternalAdded (Xamarin.Forms.View view) [0x0001d] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\Layout.cs:413
at Xamarin.Forms.Layout.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00089] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\Layout.cs:403
at (wrapper delegate-invoke) :invoke_void_object_NotifyCollectionChangedEventArgs (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
at System.Collections.ObjectModel.ObservableCollection
1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in <a547bd0d78184f26ab08d022f013c1e1>:0 at System.Collections.ObjectModel.ObservableCollection
1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in :0at System.Collections.ObjectModel.ObservableCollection
1[T].InsertItem (System.Int32 index, T item) [0x00024] in <a547bd0d78184f26ab08d022f013c1e1>:0 at System.Collections.ObjectModel.Collection
1[T].Add (T item) [0x00020] in <3fd174ff54b146228c505f23cf75ce71>:0at Xamarin.Forms.ObservableWrapper
2[TTrack,TRestrict].Add (TRestrict item) [0x0004b] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Core\ObservableWrapper.cs:35 at XYZ.PopupLayout..ctor (Xamarin.Forms.AbsoluteLayout root, Xamarin.Forms.View popup, System.Nullable
1[T] rectangle, Xamarin.Forms.AbsoluteLayoutFlags layoutFlags, TDSP.PopupLayout+Animation animation, System.Boolean isModal, System.Boolean isModalAutoClose, System.Action executeOnClose, System.Action executeOnCancel) [0x000b9] in C:\z\Phone\Controls\PopupLayout.cs:247 }`Is anyone else getting their MasterDetail being cut off by the system bar using the new pre5 nuget??
ListView ItemTapped not firing on Android in 2.3.5.253-pre5. Works fine on UWP. Reverting to pre3, which also worked fine.
Regression from 2.3.5.239-pre3.
On UWP after enabling a disabled button it is not clickable and shows no visual feedback. Works on Android.
Bugzilla:
https://bugzilla.xamarin.com/show_bug.cgi?id=57749
@SamanthaHouts Looks like we need a disposed check on the new Image fastrenderer.
Getting ObjectDisposedExceptions all over the place when using the default Tarjan GC.
Tested on XF 2.3.5-pre5.
@PhilipGruebele we have a fix for that issue already .
@Koseng thanks, we found the issue and have a fix already.
@JohnOsborn can you give us a reproducion? seems to be working fine in our tests.
@rmarinho what about the MasterDetail issue above? All I did was install the new -pre5 and that happened. Rolling back fixes it. I'm using the Android.Support 25.3.1 packages. I did not upgrade the Android Support packages when trying the new XF -pre5.
@Britton_Beckham i can't reproduce, can you give me a repo ? open a bug on bugzilla for exemple
@rmarinho Here is my android manifest the android styles I'm using. Let me know if this helps in recreating the issue. If not, I'll give you access to repo and post a bug on BugZilla.
AndroidManifest.xml:
Resources/values/styles.xml:
Resources/values-21/styles.xml:
Hi, we have found that we pushed the wrong package, was a tag from master not from 2.3.5 branch.. we have pushed aa new pre5 package also with a couple of fixes for the reported issues .. please update the app for 2.3.5.255-pre5
@Velocity We do already check for Disposed on Image Fast Renderer. Can you give me a stack trace? Thanks!
I've just updated to newest 2.3.5.255-pre5 (newer, than previous wrong 2.3.5.253-pre5), and my app is crashing at Android in MainActivity as LoadApplication(new App())
After multiple cleans, rebuilds and restarts, there is no issue
so it's update as usual 
Thanks Samantha. Please see exception and stack trace below.
Test case is just using an
Image
inside aContentView
. This is working code in XF 2.33/2.34.Exception
Cannot access a disposed object.
Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.ImageRenderer'.
Stack Trace
Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.ImageRenderer'.: System.ObjectDisposedException: Cannot access a disposed object.
@SamanthaHouts This is the other exception we are seeing.
Exception
Object name: 'Android.Graphics.Bitmap'.: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Android.Graphics.Bitmap'.
Stack Trace
@SamanthaHouts One last thing we noticed, status bar is solid white on Android.
We are styling it in style.xml. No change, working in XF 2.33/2.34.
--> Update <--
Ignore this, we had a separate "style.xml" in values-v21.
Appears this was being previously ignored, but now is taking effect with XF 2.3.5. Removing it solved the problem.
@Velocity can you open a bug with a reproduction please ?
Thanks I can confirm that my app is working properly now with 2.3.5.255-pre5
@rmarinho Thanks Rui - have created a Bugzilla report here.
Repro project to follow. Cheers!
@rmarinho Will PR 1013 make it into XF 2.3.5-pre6? I am wondering if this will resolve the issue.
@Velocity this pr is merged on 2.3.5 https://github.com/xamarin/Xamarin.Forms/commit/157f6811cd6b84a10ea2cae87a60d30016e3ad7f
make sure you have the latest pre5 you should have this fix
Further testing of XF 2.3.5.255-pre5 shows more occurrences of
ObjectDisposedException
with the fast renderers.These need to be resolved to work along with Tarjan before XF 2.3.5 is released to stable, especially given how
Label
,Button
andImage
are fundamental building blocks of most applications.Exception
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.
Stack Trace
Il make a PR to fix the label soon
UPDATE: this should fix it https://github.com/xamarin/Xamarin.Forms/pull/1021
Updating to 2.3.5.255-pre5 causes a lot of 'Object reference not set to an instance of an object' errors on my .xaml files when building my project. This did not happen on the stable version.
Thanks @Bjorn.
https://github.com/xamarin/Xamarin.Forms/pull/1021
@rmarinho .255-pre5 fixed the systembar overlapping the menu. thanks.
@Velocity we are trying to figure out exactly how the object is going through the GC and getting the finalizer called on it while it clearly still has roots cable of changing properties on the element. The element holds a reference to the renderer as the renderer is subscribed to events on the Element so it should not be getting GC'd at all. Yet clearly this is what is happening.
We desperately need a boiled down reproduction of this specific crash with LabelRenderer.UpdateText.
> @Velocity we are trying to figure out exactly how the object is going through the GC and getting the finalizer called on it while it clearly still has roots cable of changing properties on the element. The element holds a reference to the renderer as the renderer is subscribed to events on the Element so it should not be getting GC'd at all. Yet clearly this is what is happening.
>
> We desperately need a boiled down reproduction of this specific crash with LabelRenderer.UpdateText.
Thanks @TheRealJasonSmith. We're currently in the middle of a sprint, but have manage to clear aside tomorrow to work on this repro project. We really want to see this ironed out too, so happy to invest some time into it.
I'll update the ticket on Bugzilla once the repro is available. Thanks!
@TheRealJasonSmith Thanks Jason, have updated the Bugzilla ticket.
I don't think this is a blocker, but rather a specific issue related to a native collection view we have had around since XF 2.30.
Tested many different combinations together of vanilla views, nested views, labels and buttons in a view cell etc and was unable to repro. Only got this behaviour when popping pages back and forth with a RecyclerView performing layout. Removing this, I could no longer repro the problem.
2.3.5-pre5 introduced a change which seems to have broken it, but given this is an in-house control we'll make the necessary changes.
You guys seem to be working on this one I believe from the thread above, but I'm also getting this with -pre5.
I reported this when pre-3 releaesed.
And same result on pre-6.
App crashes in my second page.
VS for Mac 7.0.1(build24)
Xamarin.Forms/Android.
Xamarin.Android 7.3.1.2
Android SDK API 25
Tested on Xamarin Android Player. (Nexus 4-API23)
It's similar with
https://bugzilla.xamarin.com/show_bug.cgi?id=56594
Any suggestion would help me after you saw below log and got something in your mind.
@Britton_Beckham do you have a reproduction case for that? We are trying to work out how these objects are getting disposed while still having live connections to them. It appears they are having their finalizers run based on some stack traces and we are struggling to envision how. A repro would be hugely helpful.
@TheRealJasonSmith the best I can do is give you guys access to my app. The problem with this exception is that it is not consistent. I could perform the same action 10 times and only get it once or twice. Like @Velocity it happens more on navigation actions (it would seem) than anything else. Sadly, when debugging in VS, I get no context to where the code is when the exception happens, and as you can see from my MobileCenter stack trace, it's not much more helpful there. Would you like access to my code base?
Can you try subclassing the ImageRenderer (fast renderer) and replacing the default with your new custom one. Then override the dispose method and just start doing some tracking there for which things get called with Dispose(true) vs Dispose(false). It is my contention that a Dispose(false) is happening shortly before the crash... If you do find that lets try to figure out why.
Is there an ETA on 2.3.5 being stable? Just to give us developers a heads up of when to expect it.
Some further testing notes: it is rather difficult to produce a repro project which highlights the DisposedException crashes. However from what we have seen, the best way to increase the chance of seeing them is:
E.g. We have a production app which contains a video player. Popping the video page from the stack almost certainly causes an ObjectDisposedException to be thrown. Both the video page and the n-1 page contain Buttons, Images and Labels. However when we remove the video player, the exception is not thrown presumably as a GC cycle hasn't run.
@TheRealJasonSmith Going to try producing a repro project with manual GC invocation.
See my note above. Hopefully this can get things to break! Will report back on this later today.
@TheRealJasonSmith Came across this related crash in our quest for a repro project.
https://bugzilla.xamarin.com/show_bug.cgi?id=57910
Related to the crash with ButtonDrawable, but this time an
ObjectDisposedException
happening in the ProgressBarRenderer. Happens after pushing/popping the nav stack 2-3 times and simultaneously invoking a GC.Collect. Without the GC collect, you won't see it - which seems to confirm our theory on why it has been so difficult to get a decent repro project for this.The binding is still firing OnElementPropertyChanged after the page has been popped, the control has been disposed and so you get an
ObjectDisposedException
. We have found this is behaviour is particular noticeable when using bindings and/or with DataTriggers.Hopefully this example will make it easier to reproduce the other related disposed exceptions.
What is happening to the android buttons??
before 2.3.5 we have a button that actually looks and behaves like an android Button(); (has shadow, will raise when touched, has ripple effect)
on 2.3.5 pre 3 => no shadow, doesnt raise, has ripple
on 2.3.5 pre 6 => really? (no shadow, no ripple, no raise, dimensions?)
I dont know if its google doing some crazy stuff to their native buttons :P
But how does one get a button that looks like it did before 2.3.5 pre X ?
As a workaround I made a renderer for Button that only makes changes to devices > KitKat.
Its not perfect but it does what I need it to do
Also added a property called IsFlat to get a flat button.
has ripple, will raise when touched*, has shadow*
_* = when IsFlat = false (default)
have a look https://github.com/bentmar/XFRenderers/blob/master/Android/MaterialButtonRenderer.cs