java.lang.NoSuchMethodError: No static method getArguments()Landroid/os/Bundle on TestLab

kalkotekedarkalkotekedar USMember ✭✭
edited May 2018 in Xamarin.Android

My Android build works on real device but crashes on the test lab I am not getting the proper solution for this error log is show bellow

java.lang.NoSuchMethodError: No static method getArguments()Landroid/os/Bundle; in class Landroid/support/test/InstrumentationRegistry; or its super classes (declaration of 'android.support.test.InstrumentationRegistry' appears in /data/app/com.google.android.apps.mtaas.crawler-1/base.apk) FATAL EXCEPTION: main Process: com.corepoint.ohse, PID: 15528 java.lang.NoSuchMethodError: No static method getArguments()Landroid/os/Bundle; in class Landroid/support/test/InstrumentationRegistry; or its super classes (declaration of 'android.support.test.InstrumentationRegistry' appears in /data/app/com.google.android.apps.mtaas.crawler-1/base.apk) at com.microsoft.appcenter.utils.InstrumentationRegistryHelper.getArguments(InstrumentationRegistryHelper.java:18) at com.microsoft.appcenter.AppCenter.shouldDisable(AppCenter.java:846) at com.microsoft.appcenter.AppCenter.startServices(AppCenter.java:594) at com.microsoft.appcenter.AppCenter.configureAndStartServices(AppCenter.java:670) at com.microsoft.appcenter.AppCenter.start(AppCenter.java:298) at md5f189c09dffca887b60236aef182262a5.MainActivity.n_onCreate(Native Method) at md5f189c09dffca887b60236aef182262a5.MainActivity.onCreate(MainActivity.java:31) at android.app.Activity.performCreate(Activity.java:6876) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135) at android.support.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:215) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349) at android.app.ActivityThread.access$1100(ActivityThread.java:221) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7224) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

I am not able to find the issue, this is becuse of APPCenter or FCM I am not getting.

Best Answer

Answers

  • batmacibatmaci DEMember ✭✭✭✭✭

    you are probably using Full Linking, you need to add [Runtime.Preserve(AllMembers = true)] in your class or if it is external library add into skipped libraries or create linker xml file. see here https://xamarinhelp.com/xamarin-linker/

  • ReneFloorReneFloor NLMember

    We are having the same issue. I did some research and found the following.

    The error is from the java code that has been bound to C# and can be found on github: (I cannot post links...)
    /Microsoft/AppCenter-SDK-Android/blob/develop/sdk/appcenter/src/main/java/com/microsoft/appcenter/utils/InstrumentationRegistryHelper.java

    It calls to a method from android.support.test.InstrumentationRegistry, but that cannot be found. I cannot find Android.Support.Test on NuGet, so I guess this is java only. I think Microsoft forget to package this with the rest of AppCenter, but I don't really know how that should have worked. I tried linking, but I could not link assembly "android.support.test" and linking AppCenter assembly didn't work as that is already being found, so that is included.

  • kalkotekedarkalkotekedar USMember ✭✭

    @ReneFloor said:
    We are having the same issue. I did some research and found the following.

    The error is from the java code that has been bound to C# and can be found on github: (I cannot post links...)
    /Microsoft/AppCenter-SDK-Android/blob/develop/sdk/appcenter/src/main/java/com/microsoft/appcenter/utils/InstrumentationRegistryHelper.java

    It calls to a method from android.support.test.InstrumentationRegistry, but that cannot be found. I cannot find Android.Support.Test on NuGet, so I guess this is java only. I think Microsoft forget to package this with the rest of AppCenter, but I don't really know how that should have worked. I tried linking, but I could not link assembly "android.support.test" and linking AppCenter assembly didn't work as that is already being found, so that is included.

    On the real devices is not going to crash only crashes on test environment then

Sign In or Register to comment.