A Missing Method Exception

A created a new Xamarin Forms project for Android project and changed nothing. And when i debug it in a android simulator, the app get an error before entering onCreate method. I checked the stack trace:
Original Exception: at char.ToUpperInvariant (char)
at MonoDroid.Utils.JniType.ToPascalCase (string,int)
at MonoDroid.Utils.JniType.ToCliTypePart (string)
at MonoDroid.Utils.JniType.ToCliType (string)
at Java.Interop.TypeManager.CreateInstance (intptr,Android.Runtime.JniHandleOwnership,System.Type)
at Java.Lang.Object.GetObject (intptr,Android.Runtime.JniHandleOwnership,System.Type)
and i checked the innerException, it writes: An exception was thrown by the type initializer for System.Globalization.CultureInfo
and its innerException says : An exception was thrown by the type initializer for System.Globalization.TextInfo"
and then says: "Attempted to access a missing method." it is a MissingMethodException.

I am using Xamarin for Visual Studio 3.11.450 and the version for Xamarin.Android is 5.1.0.115

Did any body get the same problem? I need you help!

Answers

  • HalfLegendHalfLegend USMember

    Does anybody know it? Help!

  • JonWoodJonWood USUniversity ✭✭

    This is in F#, correct?

  • HalfLegendHalfLegend USMember

    No, it is in C#

  • caipigottcaipigott DEMember

    HI,

    Same here, no chance to get anything running.
    Any solution for this ?

    Greetings,
    Caipigott

  • JonWoodJonWood USUniversity ✭✭

    Is there a sample solution that shows this error?

  • MikeRowley403MikeRowley403 CAMember ✭✭✭

    We need to see the code to be able to help. Also is this in a PCL? You might be trying to access a method that is not supported in Portable Class Libraries.

  • caipigottcaipigott DEMember

    Hi,

    thanks for your reply.
    Unbelievable, today i received a notice on opening VS to update Xamarin and now, with this version, it works. I did nothing else than what i did befor - creating a new android app and start.

    Well, now it works.

    Best greetings,
    caipigott

  • Damian.3972Damian.3972 USMember

    I'm getting the same error with Vis Studio new blank solution out of the box., i.e. i've not wrritten any code myself yet

    0-03 22:19:41.822 W/ (23760): cant resolve internal call to "System.String::InternalSetLength(int)" (tested without signature also)
    10-03 22:19:41.822 E/mono (23760):
    10-03 22:19:41.822 E/mono (23760): Your mono runtime and class libraries are out of sync.
    10-03 22:19:41.822 E/mono (23760): The out of sync library is: mscorlib.dll
    10-03 22:19:41.822 E/mono (23760):
    10-03 22:19:41.822 E/mono (23760): When you update one from svn you need to update, compile and install
    10-03 22:19:41.822 E/mono (23760): the other too.
    10-03 22:19:41.822 E/mono (23760): Do not report this as a bug unless you're sure you have updated correctly:
    10-03 22:19:41.822 E/mono (23760): you probably have a broken mono install.
    10-03 22:19:41.822 E/mono (23760): If you see other errors or faults after this message they are probably related
    10-03 22:19:41.822 E/mono (23760): and you need to fix your mono install first.
    10-03 22:19:41.822 W/ (23760): cant resolve internal call to "System.String::InternalSetLength(int)" (tested without signature also)
    10-03 22:19:41.822 E/mono (23760):
    10-03 22:19:41.822 E/mono (23760): Your mono runtime and class libraries are out of sync.
    10-03 22:19:41.822 E/mono (23760): The out of sync library is: mscorlib.dll
    10-03 22:19:41.822 E/mono (23760):
    10-03 22:19:41.822 E/mono (23760): When you update one from svn you need to update, compile and install
    10-03 22:19:41.822 E/mono (23760): the other too.
    10-03 22:19:41.822 E/mono (23760): Do not report this as a bug unless you're sure you have updated correctly:
    10-03 22:19:41.822 E/mono (23760): you probably have a broken mono install.
    10-03 22:19:41.822 E/mono (23760): If you see other errors or faults after this message they are probably related
    10-03 22:19:41.822 E/mono (23760): and you need to fix your mono install first.
    10-03 22:19:41.822 E/mono (23760):
    10-03 22:19:41.822 E/mono (23760): Unhandled Exception:
    10-03 22:19:41.822 E/mono (23760): Nested exception detected.
    10-03 22:19:41.822 E/mono (23760): Original Exception: at char.ToUpperInvariant (char) <0x0000f>
    10-03 22:19:41.822 E/mono (23760): at MonoDroid.Utils.JniType.ToPascalCase (string,int) <0x00043>
    10-03 22:19:41.822 E/mono (23760): at MonoDroid.Utils.JniType.ToCliTypePart (string) <0x0002f>
    10-03 22:19:41.822 E/mono (23760): at MonoDroid.Utils.JniType.ToCliType (string) <0x0009f>
    10-03 22:19:41.822 E/mono (23760): at Java.Interop.TypeManager.CreateInstance (intptr,Android.Runtime.JniHandleOwnership,System.Type) <0x001f7>
    10-03 22:19:41.822 E/mono (23760): at Java.Lang.Object.GetObject (intptr,Android.Runtime.JniHandleOwnership,System.Type) <0x002cf>
    10-03 22:19:41.822 E/mono (23760): at Java.Lang.Object._GetObject<Java.Lang.Thread/IUncaughtExceptionHandler> (intptr,Android.Runtime.JniHandleOwnership) <0x0004f>
    10-03 22:19:41.822 E/mono (23760): at Java.Lang.Object.GetObject<Java.Lang.Thread/IUncaughtExceptionHandler> (intptr,Android.Runtime.JniHandleOwnership) <0x0002b>
    10-03 22:19:41.822 E/mono (23760): at Java.Lang.Thread.get_DefaultUncaughtExceptionHandler () <0x0007b>
    10-03 22:19:41.822 E/mono (23760): at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs*) <0x009b7>

  • Same comment as here: https://forums.xamarin.com/discussion/4731/problem-with-release

    This fixed it for me following Xamarin Studio updates on OS X - your mileage may vary!
    1. In Xamarin Studio - Clean solution
    2. In emulator - Settings -> Apps -> Uninstall "Mono Shared Runtime", "Xamarin.Android API-* Support", "Xamarin.*.SmokeTests",
    3. Reboot entire machine (old Windows habit following new software install)
    4. Start Xamarin Studio
    5. Start emulator
    6. Rebuild
    7. Debug to emulator

    If I had to guess, it was step 2 that got rid of a prior version of the Mono Shared Runtime and resolved the "Your mono runtime and class libraries are out of sync" error.

  • GeorgiGeorgievGeorgiGeorgiev USMember ✭✭

    New rule of thumb - Every time you update anything related to your tooling(xamarin, sdk, etc.) follow the above steps :smile:

  • Adam.HockemeyerAdam.Hockemeyer USUniversity ✭✭

    Also you could go (Visual Studio Mac anyway) to Tools --> Google Emulator Manager. Click on the AVD you are trying to use (possibly Android_Accelerated_x86) and click the "Start" button. Be sure to check the "Wipe user data" checkbox.

    This should launch a fresh emulator for you.

Sign In or Register to comment.