Application stops before showing anything

Hey you guys, I've got some problems, only one for now.

I deploy my application to Google Play about 2 months ago, and yesterday I received an email relating the app does not open in a device and it break before open, showing on the screen "Unfortunately, (?) Has stopped". It runs normaly in another device, but not in the "J3 (2016) android version 5.11's user".
I opened the Google Play Console, and looked for answers in ANR's menu. I found this:

at md5846bd09d5a4e74db0c2de01aa9d1e1cf.MainActivity.n_onCreate (Native Method)
at md5846bd09d5a4e74db0c2de01aa9d1e1cf.MainActivity.onCreate (
at (
at (
at (
at (
at$1000 (
at$H.handleMessage (
at android.os.Handler.dispatchMessage (
at android.os.Looper.loop (
at (
at java.lang.reflect.Method.invoke (Native Method)
at java.lang.reflect.Method.invoke (
at$ (
at (

I'll try to reproduce this error via android emulator.
Does anybody seen this before, know how to solve and can help me?

Thank you guys.

Best Answer


  • FurnariFurnari Member ✭✭

    You tried it in another device with lollipop 5.1.1?

  • Brand00wnBrand00wn Member ✭✭

    I tried to emulate my app by Android Emulator with Lollipop 5.1.1, and I've got the same error. The debugger return me this message: "Java.Lang.LinkageError: ".

  • JarvanJarvan Member, Xamarin Team Xamurai

    The root cause is that you most likely have compiled a class against a different version of the class that is missing a method.

  • Brand00wnBrand00wn Member ✭✭

    After some tests here, I saw that the application only runs from Android 6.0 to up, and this error repeats in lowest versions.

  • JarvanJarvan Member, Xamarin Team Xamurai

    This method is estimated to be introduced for the first time in Android 6.0.

  • Brand00wnBrand00wn Member ✭✭
    edited March 2019

    Ok, but... How to know which method it is? Because in the ANR's report I see a lot of methods. If I want to reformulate my application to run in a lowest android version, I have to change all of these methods that appear in ANR?

  • Brand00wnBrand00wn Member ✭✭
    edited March 2019

    Guys, I have some news... Analysing my code, I noticed that if I comment, in MainActivity.cs the line thath calls RequestPermissions(), the application runs normally in lowest versions. I'll share this code above:

    protected async override void OnCreate(Bundle savedInstanceState)
                TabLayoutResource = Resource.Layout.Tabbar;
                ToolbarResource = Resource.Layout.Toolbar;
                Xamarin.Essentials.Platform.Init(this, savedInstanceState);
                //RequestPermissions(Permission, RequestId);
                Xamarin.Forms.Forms.Init(this, savedInstanceState);
                LoadApplication(new App());
                var data = Intent.Data;
                if (data != null)
                    <Here occours the Handler Protocol>

    And the RequestPermission() is part of Mono.Android.dll:

    public void RequestPermissions(string[] permissions, int requestCode);
            [Register("requestShowKeyboardShortcuts", "()V", "", ApiSince = 24)]
            public void RequestShowKeyboardShortcuts();

    Is there another way to Request this Permission?

  • Brand00wnBrand00wn Member ✭✭

    Hitted the nail on the head, JohnHair!! Permissions are only required from Android 6.0, below this, needn't it. I used a structure to verify the device's Android Version, then, if it is up to 6.0, asks permission, else, does nothing.

Sign In or Register to comment.