Bug 32034 - MissingMethodException while pushing and popping pages
Summary: MissingMethodException while pushing and popping pages
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.4.4
Hardware: Macintosh Mac OS
: Normal blocker
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-07-16 12:31 UTC by Falko Schindler
Modified: 2017-06-17 00:44 UTC (History)
5 users (show)

Tags: ac regression
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:
RESOLVED NORESPONSE

Description Falko Schindler 2015-07-16 12:31:49 UTC
The bug is reproducible with the following Xamarin.Forms App:

    public class App : Application
    {
        public static NavigationPage Page;

        public App()
        {
            MainPage = Page = new NavigationPage(new ButtonPage());
        }
    }

    public class ButtonPage: ContentPage
    {
        public ButtonPage()
        {
            Content = new StackLayout {
                Children = {
                    new Button { Text = "Push", Command = new Command(o => App.Page.PushAsync(new ButtonPage())) },
                    new Button { Text = "Pop", Command = new Command(o => App.Page.Navigation.PopAsync()) },
                },
            };
        }
    }

After pressing "Push" and "Pop" several times (maybe 30 times or more), the following exception is raised:

[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.RendererFactory+DefaultRenderer from native handle a8e00019 ---> System.MissingMethodException: No constructor found for Xamarin.Forms.Platform.Android.RendererFactory+DefaultRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
[MonoDroid] Java.Lang.Error: Exception of type 'Java.Lang.Error' was thrown.
[MonoDroid]   --- End of managed exception stack trace ---
[MonoDroid] java.lang.Error: Java callstack:
[MonoDroid] 	at md5530bd51e982e6e7b340b73e88efe666e.VisualElementRenderer_1.n_onShowPress(Native Method)
[MonoDroid] 	at md5530bd51e982e6e7b340b73e88efe666e.VisualElementRenderer_1.onShowPress(VisualElementRenderer_1.java:105)
[MonoDroid] 	at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:310)
[MonoDroid] 	at android.os.Handler.dispatchMessage(Handler.java:99)
[MonoDroid] 	at android.os.Looper.loop(Looper.java:137)
[MonoDroid] 	at android.app.ActivityThread.main(ActivityThread.java:4867)
[MonoDroid] 	at java.lang.reflect.Method.invokeNative(Native Method)
[MonoDroid] 	at java.lang.reflect.Method.invoke(Method.java:511)
[MonoDroid] 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
[MonoDroid] 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
[MonoDroid] 	at dalvik.system.NativeStart.main(Native Method)
[MonoDroid]   --- End of inner exception stack trace ---
[MonoDroid]   at Java.Interop.TypeManager.CreateProxy (System.Type type, IntPtr handle, JniHandleOwnership transfer) [0x00039] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Java.Interop/TypeManager.cs:267 
[MonoDroid]   at Java.Interop.TypeManager.CreateInstance (IntPtr handle, JniHandleOwnership transfer, System.Type targetType) [0x001ea] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Java.Interop/TypeManager.cs:249 
[MonoDroid]   --- End of inner exception stack trace ---
[MonoDroid] at Java.Interop.TypeManager.CreateInstance (intptr,Android.Runtime.JniHandleOwnership,System.Type) [0x0022b] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Java.Interop/TypeManager.cs:255
[MonoDroid] at Java.Lang.Object.GetObject (intptr,Android.Runtime.JniHandleOwnership,System.Type) [0x000e5] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Java.Lang/Object.cs:373
[MonoDroid] at Java.Lang.Object._GetObject<Android.Views.GestureDetector/IOnGestureListener> (intptr,Android.Runtime.JniHandleOwnership) <0x000cf>
[MonoDroid] at Java.Lang.Object.GetObject<Android.Views.GestureDetector/IOnGestureListener> (intptr,Android.Runtime.JniHandleOwnership) <0x0006f>
[MonoDroid] at Java.Lang.Object.GetObject<Android.Views.GestureDetector/IOnGestureListener> (intptr,intptr,Android.Runtime.JniHandleOwnership) <0x0008b>
[MonoDroid] at Android.Views.GestureDetector/IOnGestureListenerInvoker.n_OnShowPress_Landroid_view_MotionEvent_ (intptr,intptr,intptr) [0x00000] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.Views.GestureDetector.cs:486
[MonoDroid] at (wrapper dynamic-method) object.7d54fae7-12ac-4707-9edd-8aba7465a6d3 (intptr,intptr,intptr) <IL 0x00017, 0x00043>
[AndroidRuntime] Shutting down VM

The bug only occurs with 1.4.4-pre1. The previous release 1.4.3 seams to be ok.
Comment 1 Falko Schindler 2015-07-16 12:36:10 UTC
In my production app I stumbled upon the following exception, which I couldn't reproduce with a minimum example. I guess it's closely related to the one thrown by the code shown above. Therefore, I don't want to file a separate bug. But maybe it's helpful for debugging to see this exception as well:

[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.LabelRenderer from native handle bead123c ---> System.MissingMethodException: No constructor found for Xamarin.Forms.Platform.Android.LabelRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
[MonoDroid] Java.Lang.Error: Exception of type 'Java.Lang.Error' was thrown.
[MonoDroid]   --- End of managed exception stack trace ---
[MonoDroid] java.lang.Error: Java callstack:
[MonoDroid]     at md5530bd51e982e6e7b340b73e88efe666e.VisualElementRenderer_1.n_onLongPress(Native Method)
[MonoDroid]     at md5530bd51e982e6e7b340b73e88efe666e.VisualElementRenderer_1.onLongPress(VisualElementRenderer_1.java:89)
[MonoDroid]     at android.view.GestureDetector.dispatchLongPress(GestureDetector.java:690)
[MonoDroid]     at android.view.GestureDetector.access$200(GestureDetector.java:37)
[MonoDroid]     at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:266)
[MonoDroid]     at android.os.Handler.dispatchMessage(Handler.java:102)
[MonoDroid]     at android.os.Looper.loop(Looper.java:135)
[MonoDroid]     at android.app.ActivityThread.main(ActivityThread.java:5254)
[MonoDroid]     at java.lang.reflect.Method.invoke(Native Method)
[MonoDroid]     at java.lang.reflect.Method.invoke(Method.java:372)
[MonoDroid]     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
[MonoDroid]     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
[MonoDroid]   --- End of inner exception stack trace ---
[MonoDroid]   at Java.Interop.TypeManager.CreateProxy (System.Type type, IntPtr handle, JniHandleOwnership transfer) [0x00039] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Java.Interop/TypeManager.cs:267 
[MonoDroid]   at Java.Interop.TypeManager.CreateInstance (IntPtr handle, JniHandleOwnership transfer, System.Type targetType) [0x001ea] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Java.Interop/TypeManager.cs:249 
[MonoDroid]   --- End of inner exception stack trace ---
[MonoDroid] at Java.Interop.TypeManager.CreateInstance (intptr,Android.Runtime.JniHandleOwnership,System.Type) [0x0022b] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Java.Interop/TypeManager.cs:255
[MonoDroid] at Java.Lang.Object.GetObject (intptr,Android.Runtime.JniHandleOwnership,System.Type) [0x000e5] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Java.Lang/Object.cs:373
[MonoDroid] at Java.Lang.Object._GetObject<Android.Views.GestureDetector/IOnGestureListener> (intptr,Android.Runtime.JniHandleOwnership) <0x000cf>
[MonoDroid] at Java.Lang.Object.GetObject<Android.Views.GestureDetector/IOnGestureListener> (intptr,Android.Runtime.JniHandleOwnership) <0x0006f>
[MonoDroid] at Java.Lang.Object.GetObject<Android.Views.GestureDetector/IOnGestureListener> (intptr,intptr,Android.Runtime.JniHandleOwnership) <0x0008b>
[MonoDroid] at Android.Views.GestureDetector/IOnGestureListenerInvoker.n_OnLongPress_Landroid_view_MotionEvent_ (intptr,intptr,intptr) [0x00000] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.Views.GestureDetector.cs:426
[MonoDroid] at (wrapper dynamic-method) object.32d217d2-619c-4289-b31c-29a99ab8fca2 (intptr,intptr,intptr) <IL 0x00017, 0x00043>
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable
[AndroidRuntime] Shutting down VM
Comment 2 Jason Smith [MSFT] 2015-07-22 18:16:53 UTC
Should be fixed in 1.4.4-pre4
Comment 3 Stefan de Vogelaere 2016-03-26 10:46:25 UTC
I am sure that this is BACK with all the latest bits of Xamarin Forms in ANdroid!
Really annoying
Comment 4 Stefan de Vogelaere 2016-03-26 10:47:03 UTC
Pls have a look at my Insights: https://insights.xamarin.com/app/kpd-timesheets-qa it's full of it!
Comment 6 Stefan de Vogelaere 2016-03-30 10:29:43 UTC
It seems it has something todo with Xamarin.Android
Reverted back to stable release Version: 6.0.2.1 (Enterprise Edition) without the errors. On Alpha Change 6.1.x these things are happening again!
Comment 7 Jason Smith [MSFT] 2016-04-11 07:43:45 UTC
Do you have any reproduction we can use to try to track this down?
Comment 8 Stefan de Vogelaere 2016-04-11 08:03:59 UTC
I don't think it is a Xamarin Forms issue, I rolled back to Xamarin.Android in the stable channel and the errors where gone.
I can only point you to the insights link above because I could not reproduce this, but all of my users had these errors.
Comment 9 David Ortinau [MSFT] 2017-06-17 00:44:33 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information and a project that demonstrates this issue. Thanks!