locked
Issue after upgrading v4 Support Library RRS feed

  • Question

  • User40440 posted

    Hi all !

    I have an issue after upgrading my v4 Support Library Package From v21 to v22.

    My app crashes when trying to use a Custom Renderer inheriting from ListViewRenderer. It worked perfectly before upgrade.

    I tried to upgrade my SDKs through the Android SDK Manager but it doesn't solve my problem.

    Thanks a lot !

    Here is the exception :

    [MonoDroid] System.MissingMethodException: Method not found: 'Android.Runtime.JNIEnv.StartCreateInstance'. [MonoDroid] at Xamarin.Forms.Platform.Android.ListViewRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs1 e) [0x00000] in <filename unknown>:0 [MonoDroid] at PicardInventaire.Droid.Renderers.NoLongPressListViewRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs1 e) [0x00001] in c:\DEV\Xamarin Projects\PicardInventaire\Droid\Renderers\NoLongPressListView.cs:18 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer1[Xamarin.Forms.ListView].SetElement (Xamarin.Forms.ListView element) [0x00000] in <filename unknown>:0 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer1[Xamarin.Forms.ListView].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in :0 [MonoDroid] at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement view) [0x00000] in :0 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, Boolean sameChildren) [0x00000] in :0 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00000] in :0 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in :0 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer1[Xamarin.Forms.View].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00000] in <filename unknown>:0 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer1[Xamarin.Forms.View].SetElement (Xamarin.Forms.View element) [0x00000] in :0 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer1[Xamarin.Forms.View].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in <filename unknown>:0 [MonoDroid] at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement view) [0x00000] in <filename unknown>:0 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, Boolean sameChildren) [0x00000] in <filename unknown>:0 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00000] in <filename unknown>:0 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in <filename unknown>:0 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer1[Xamarin.Forms.Page].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00000] in :0 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer1[Xamarin.Forms.Page].SetElement (Xamarin.Forms.Page element) [0x00000] in <filename unknown>:0 [MonoDroid] at Xamarin.Forms.Platform.Android.VisualElementRenderer1[Xamarin.Forms.Page].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in :0 [MonoDroid] at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement view) [0x00000] in :0 [MonoDroid] at Xamarin.Forms.Platform.Android.NavigationRenderer.SwitchContentAsync (Xamarin.Forms.Page view, Boolean animated, Boolean removed) [0x00000] in :0 [MonoDroid] at Xamarin.Forms.Platform.Android.NavigationRenderer.OnPushAsync (Xamarin.Forms.Page view, Boolean animated) [0x00000] in :0 [MonoDroid] at Xamarin.Forms.Platform.Android.NavigationRenderer.PushViewAsync (Xamarin.Forms.Page page, Boolean animated) [0x00000] in :0 [MonoDroid] at Xamarin.Forms.Platform.Android.NavigationRenderer.OnPushed (System.Object sender, Xamarin.Forms.NavigationRequestedEventArgs e) [0x00000] in :0 [MonoDroid] at Xamarin.Forms.NavigationPage+d16.MoveNext () [0x00000] in :0 [MonoDroid] --- End of stack trace from previous location where exception was thrown --- [MonoDroid] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in :0 [MonoDroid] at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in :0 [MonoDroid] at Xamarin.Forms.NavigationPage+d11.MoveNext () [0x00000] in :0 [MonoDroid] --- End of stack trace from previous location where exception was thrown --- [MonoDroid] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in :0 [MonoDroid] at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in :0 [MonoDroid] at PicardInventaire.Pages.LoginPage+d__3.MoveNext () [0x0022e] in c:\DEV\Xamarin Projects\PicardInventaire\PicardInventaire\Pages\LoginPage.xaml.cs:49

    Monday, April 27, 2015 6:19 PM

Answers

  • User42522 posted

    @MauroCasu Before I could even try downgrading the V4 pkg, the V22.1.1.1 has arrived and it worked. Now there were a host of Xamarin updates have come and they are yet to work well with my setup.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, May 1, 2015 3:20 PM

All replies

  • User40440 posted

    In fact the issue is still here with the Standard ListView Renderer :

     Missing method Android.Runtime.JNIEnv::StartCreateInstance(Type,string,JValue*) in assembly Mono.Android.dll, referenced in assembly /storage/sdcard0/Android/data/PicardInventaire.Droid/files/.__override__/Xamarin.Android.Support.v4.dll
    
    Monday, April 27, 2015 6:26 PM
  • User8168 posted

    I have exactly the same issue. A project using Master/Detail crashes after the update with the same error of missing method StartCreateInstance:

    System.Diagnostics.Debugger.MonoUnhandledExceptioninternal () in System.Diagnostics.Debugger.Mono_UnhandledException (ex={System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Android.Runtime.JNIEnv.StartCreateInstance'. at Xamarin.Forms.Platform.Android.MasterDetailRenderer..ctor ()

    The project worked perfectly before the upgrade.

    Thanks, Mauro

    Monday, April 27, 2015 7:38 PM
  • User3466 posted

    @EmmanuelGonzalez, @MauroCasu can you run a Build, Clean operation, then Rebuild All to see if that fixes the issue?

    I've recently seen some of the updates to the codebase require a complete fresh build of your application.

    Monday, April 27, 2015 8:23 PM
  • User8168 posted

    Hi Mitch, I have tried to clean all and rebuild but same issue. The only way I have found to fix it, is to downgrade Xamarin.Android.Support.V4 from version 22.1.1 to ver 22.0.0. I am using Xamarin Studio 5.8.3 on a Mac.

    Thanks, Mauro

    Tuesday, April 28, 2015 1:37 AM
  • User52543 posted

    The same error here, how to fix it? anybody from Xamarin already know about this? @TheRealJasonSmith @CraigDunn

    Tuesday, April 28, 2015 8:25 AM
  • User17372 posted

    I've the same error with the latest Grid Demo Sample from DevExpress (for their latest version 15.1.3 of DevExpress Grid for Xamarin Forms; version 15.1.2 worked). Could not find a solution for this until now ..

    Tuesday, April 28, 2015 10:27 AM
  • User1544 posted

    Same error here. An App with a Master-Detail-Page crashes on LoadApplication with that error.

    Tuesday, April 28, 2015 11:24 AM
  • User118354 posted

    Same issue here. LoadApplication crashes with mscorlib issues.

    Tuesday, April 28, 2015 11:34 AM
  • User63505 posted

    I'm also seeing the issue with the MasterDetailPage

    Tuesday, April 28, 2015 12:25 PM
  • User81593 posted

    Same issue here

    Tuesday, April 28, 2015 12:43 PM
  • User124115 posted

    Same issue as well here. With MasterDetailPage.

    Tuesday, April 28, 2015 3:24 PM
  • User80190 posted

    Same issue with me when using MasterDetailPage. LoadApplication is throwing:

    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Android.Runtime.JNIEnv.StartCreateInstance'. [mono] at Xamarin.Forms.Platform.Android.MasterDetailRenderer..ctor () [0x00000] in :0 [mono] at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) [mono] at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in :0

    Tuesday, April 28, 2015 3:27 PM
  • User1544 posted

    Filed a bug: https://bugzilla.xamarin.com/show_bug.cgi?id=29471

    Tuesday, April 28, 2015 4:16 PM
  • User42522 posted

    @MauroCasu How do you downgrade to v22.0.0? On Mac I don't find any option in the 'Add Packages' window.

    Tuesday, April 28, 2015 5:17 PM
  • User8168 posted

    @ShantimohanElchuri To downgrade a package on Xamarin Studio for Mac, you can just add the same package again with the keyword "version:" at the end, like this: Xamarin.Android.Support.V4 version: It will show to you all the available versions for this package and then, if you add it again (with a previous version), it will be replaced. Consider that some packages have dependencies and you are sometimes required to downgrade other packages as well.

    Mauro

    Tuesday, April 28, 2015 5:59 PM
  • User8168 posted

    @ShantimohanElchuri Sorry in my previous post I forgot a star () at the end of the keyword "version:", the right example is this: Xamarin.Android.Support.V4 version:

    Mauro

    Tuesday, April 28, 2015 6:01 PM
  • User8168 posted

    @ShantimohanElchuri Looking at my previous posts, in my browser the star does not appear... :( anyway, if you don't see it, just add a star after the colon at the end of the version keyword.

    Mauro

    Tuesday, April 28, 2015 6:04 PM
  • User11422 posted

    I'm getting the same issue at LoadApplication(...) with X.Forms v1.4.2.6355 and X.Android.Support.v4 v22.0.0.0 Error dump and system config attached.

    Wednesday, April 29, 2015 1:13 AM
  • User8168 posted

    I have tried the new version of the package (22.1.1.1) and now the issue seems correctly fixed.

    Thanks, Mauro

    Thursday, April 30, 2015 3:40 AM
  • User42522 posted

    @MauroCasu Before I could even try downgrading the V4 pkg, the V22.1.1.1 has arrived and it worked. Now there were a host of Xamarin updates have come and they are yet to work well with my setup.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, May 1, 2015 3:20 PM
  • User107187 posted

    I just had the same issue with the latest nugets of both xamarin forms and Android.Support.v4. However after many hours of head scratching I tried to upgrade xamarins visual studio plugin. It weirdly worked after that?!?!?

    Tuesday, August 25, 2015 11:26 AM