weixin_39717110
weixin_39717110
2021-01-03 23:42

NullReferenceException on Android after Xamarin Forms update to 4.4.0.991265

I updated my Xamarin Forms project from Xamarin Forms 4.3.0.991250 to 4.4.0.991265 and now get the following NullReferenceException when I start my Android project. iOS works.

  at CarouselView.FormsPlugin.Android.CarouselViewRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1[TElement] e) [0x00132] in <892bb6a09e5d43ddbe9591d58bbf4c0e>:0 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000b8] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:231 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344 
  at Xamarin.Forms.Platform.Android.ScrollViewContainer.set_ChildView (Xamarin.Forms.View value) [0x0002f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewContainer.cs:37 
  at Xamarin.Forms.Platform.Android.ScrollViewRenderer.LoadContent () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:364 
  at Xamarin.Forms.Platform.Android.ScrollViewRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x000cf] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:97 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334 
  at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234 
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128 
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Support.V4.App.FragmentManager fragmentManager, Android.Content.Context context) [0x00031] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:391 
  at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState) [0x00008] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FragmentContainer.cs:56 
  at Android.Support.V4.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_inflater, System.IntPtr native_container, System.IntPtr native_savedInstanceState) [0x00020] in <4778c530db8c472280798b576df9ad7a>:0 
  at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.56(intptr,intptr,intptr,intptr,intptr)

该提问来源于开源项目:alexrainman/CarouselView

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

46条回答

  • weixin_39797758 weixin_39797758 3月前

    Same here. Upgraded project to Android X using latest Xamarin Forms 4.5 and I get the same exception. iOS seems to be still working fine with SDK 10.13. My CarouselView is indeed in a ScrollView.

    
    [AndroidRuntime] android.runtime.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an object
    [AndroidRuntime]   at CarouselView.FormsPlugin.Android.CarouselViewRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1[TElement] e) [0x00132] in <892bb6a09e5d43ddbe9591d58bbf4c0e>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000c0] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000c0] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00033] in <9e919e04-01 15:20:29.602 E/AndroidRuntime( 7001):   at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x0016c] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000dd] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00033] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.ScrollViewContainer.set_ChildVie04-01 15:20:29.602 E/AndroidRuntime( 7001):   at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.ScrollViewRenderer.LoadContent () [0x00011] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.ScrollViewRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x000cf] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms04-01 15:20:29.602 E/AndroidRuntime( 7001):   at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000c0] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000dd] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]    at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.jav.VisualElement element) [0x00033] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, AndroidX.Fragment.App.FragmentManager fragmentManager, Android.Content.Context context) [0x00031] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState) [0x0001b] in <9e919e3d32554840a213a0a951bd96a0>:0 
    [AndroidRuntime]   at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_inflater, System.IntPtr native_container, System.IntPtr native_savedInstanceState) [0x00020] in <b76de9b16cb343a5bac3158989a50655>:0 
    [AndroidRuntime]    at crc64720bb2db43a66fe9.FragmentContainer.n_onCreateView(Native Method)
    [AndroidRuntime]    at crc64720bb2db43a66fe9.FragmentContainer.onCreateView(FragmentContainer.java:41)
    [AndroidRuntime]    at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2698)
    [AndroidRuntime]    at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:320)
    [AndroidRuntime]    at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1187)
    [AndroidRuntime]    at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1356)
    [AndroidRuntime]    at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1434)
    [AndroidRuntime]    at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1497)
    [AndroidRuntime]    at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447)
    [AndroidRuntime]    at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2169)
    [AndroidRuntime]    at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1992)
    [AndroidRuntime]    at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1947)
    [AndroidRuntime]    at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1849)
    [AndroidRuntime]    at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:413)
    [AndroidRuntime]    at android.os.Handler.handleCallback(Handler.java:883)
    [AndroidRuntime]    at android.os.Handler.dispatchMessage(Handler.java:100)
    [AndroidRuntime]    at android.os.Looper.loop(Looper.java:214)
    [AndroidRuntime]    at android.app.ActivityThread.main(ActivityThread.java:7356)
    [AndroidRuntime]    at java.lang.reflect.Method.invoke(Native Method)
    [AndroidRuntime]    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    [AndroidRuntime]    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
    [Process] Sending signal. PID: 7001 SIG: 9
    </b76de9b16cb343a5bac3158989a50655>
    点赞 评论 复制链接分享
  • weixin_39809140 weixin_39809140 3月前

    I am getting this issue as well. When the CarouselViewControl version 5.2 is inside a ScrollView in a Android app it crashes. When you use CarouselViewControl version 5.0.2 with the Xamarin.Forms 4.5.0.530 it doesn't crash. Ohh Xamarin....

    点赞 评论 复制链接分享
  • weixin_39644146 weixin_39644146 3月前

    I am getting this issue as well. When the CarouselViewControl version 5.2 is inside a ScrollView in a Android app it crashes. When you use CarouselViewControl version 5.0.2 with the Xamarin.Forms 4.5.0.530 it doesn't crash. Ohh Xamarin....

    And I for once, didn't understand how is it supposed to be a Xamarin issue? Isn't it an issue with CarouselViewControl?

    点赞 评论 复制链接分享
  • weixin_39809140 weixin_39809140 3月前

    I am getting this issue as well. When the CarouselViewControl version 5.2 is inside a ScrollView in a Android app it crashes. When you use CarouselViewControl version 5.0.2 with the Xamarin.Forms 4.5.0.530 it doesn't crash. Ohh Xamarin....

    And I for once, didn't understand how is it supposed to be a Xamarin issue? Isn't it an issue with CarouselViewControl?

    Yes I believe it's a CarouselViewControl issue....I just was giving details on what makes it crash and a work around by using a older version of CarouselViewControl. "Ohh Xamarin" --- Is just me being a bit exasperated by Xamarin in general.

    点赞 评论 复制链接分享
  • weixin_39578197 weixin_39578197 3月前

    Hi Guys,

    I encountered the same problem after upgrade to Xamarin.Forms 4.5.0.530. After moving the CarouselViewControl outside the Scrollview, the problem was solved. It is working fine now.

    点赞 评论 复制链接分享
  • weixin_39651325 weixin_39651325 3月前

    Hello,

    Same problem with last XF 4.5.x.

    After a debug session:

    It seems that in the constuctor of CarouselViewRenderer

    
     public CarouselViewRenderer(Context context) : base(context)
            {
                _context = context;
    
                // KeyboardService code
                var activity = _context as Activity;
                if (activity != null)
                    keyboardService = new SoftKeyboardService(activity);
            }
    
    

    activity is null => then keyboardService is null => then a NRE occurs at the last instruction of OnElementChanged manipulating this reference:

    keyboardService.VisibilityChanged += KeyboardService_VisibilityChanged; and keyboardService.VisibilityChanged -= KeyboardService_VisibilityChanged;

    , I guess Xamarin Forms behavior has changed a bit (perhaps a bug). I think you should at least protect usage of keyboardService that can be null. Or get CurrentActivity in a different way.

    Anyway, I put a very dirty workaround on my side for the moment:

    
    //...
     public class CarouselViewExtendedRenderer : CarouselView.FormsPlugin.Android.CarouselViewRenderer
    
    //...
           protected override void OnElementChanged(ElementChangedEventArgs<carouselviewcontrol> e)
            {
                try
                {
                    base.OnElementChanged(e);
                }
                catch (Exception ex)
                {
                    //Fix Issue related to CarouselView and Xamarin Forms
                }
            }
    
    </carouselviewcontrol>

    KeyboardService_VisibilityChanged is then not attached. The optimization related to this event handler is not required for me (Carousel + Keyboard display)

    I hope it will help

    点赞 评论 复制链接分享
  • weixin_39804631 weixin_39804631 3月前

    It is solved after updating xamarin to version 4.6.0.800

    点赞 评论 复制链接分享
  • weixin_39797758 weixin_39797758 3月前

    This is still happening for me with 5.2 version and latest XF 4.8.0.1451

    
    [AppCenterCrashes] Unhandled Exception from source=AndroidEnvironment
    [AppCenterCrashes] System.NullReferenceException: Object reference not set to an instance of an object.
    [AppCenterCrashes]   at CarouselView.FormsPlugin.Android.CarouselViewRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1[TElement] e) [0x00132] in <892bb6a09e5d43ddbe9591d58bbf4c0e>:0 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000cb] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:245 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00033] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:135 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.09-29 17:39:22.770 E/AppCenterCrashes(15129):   at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000b3] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:140 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00163] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:351 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.ConteForms.Platform.Android\VisualElementPackager.cs:112 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:470 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000e8] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:248 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00033] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:135 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.ScrollViewContainer.set_ChildView (Xamarin.Forms.View value) [0x0002f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewContainer.cs:35 
    [Mono] Requesting loading reference 5 (of 6) of /storage/emulated/0/Andro09-29 17:39:22.770 E/AppCenterCrashes(15129):   at Xamarin.Forms.Platform.Android.ScrollViewRenderer.LoadContent () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:373 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.ScrollViewRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x000cf] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:103 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:350 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00163] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:351 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:112 
    [AppCenterCrashes]   at Xamarin.Forms.Platform.Android.Vi
    
    点赞 评论 复制链接分享
  • weixin_39797758 weixin_39797758 3月前

    Sadly, I also ended up using XF's built-in CarouselView and IndicatorView - doesn't crash.

    点赞 评论 复制链接分享
  • weixin_39754616 weixin_39754616 3月前

    Going to do one last release of this plugin in the next few days.

    点赞 评论 复制链接分享
  • weixin_39849888 weixin_39849888 3月前

    I tested with several configurations. This error occurs only on Android with Xamarin.Forms 4.8.0.1451 and 4.8.0.1534. When I downgraded Xamarin.Forms to version 4.8.0.1364, the error didn't happen anymore.

    I am using Xamarin.FFImageLoading version 2.4.11.982 with CachedImageRenderer.InitImageViewHandler() and binding CarouselViewControl.ItemsSource to a List<CachedImage>:

    
    new List<cachedimage>()
    {
        new CachedImage {
            Source = string.IsNullOrEmpty(imageUrl) ? "no_image.jpeg" : imageUrl,
            DownsampleToViewSize = true,
            Aspect = Aspect.AspectFit
        }
    };
    </cachedimage>
    点赞 评论 复制链接分享
  • weixin_39797758 weixin_39797758 3月前

    Hey Alex,

    Do you still intend to produce a newer version in an attempt to fix / workaround this issue?

    XF's IndicatorView is not working so well for me on iOS so... ;)

    点赞 评论 复制链接分享
  • weixin_39754616 weixin_39754616 3月前

    Expect a new version with this issue fixed soon.

    点赞 评论 复制链接分享
  • weixin_39960116 weixin_39960116 3月前

    Hello ! Do you have any estimations regarding the new version release date?

    点赞 评论 复制链接分享
  • weixin_39756540 weixin_39756540 3月前

    I am able to reproduce this using Xamarin.Forms 4.8.0.1560 and CarouselView.FormsPlugin v5.2.0. Works fine in iOS so defaulted to out of box Carousel for Android

    点赞 评论 复制链接分享
  • weixin_39900830 weixin_39900830 3月前

    Waiting for the new release 👍

    点赞 评论 复制链接分享
  • weixin_39900830 weixin_39900830 3月前

    Please let us know the new release updates..

    点赞 评论 复制链接分享
  • weixin_39543652 weixin_39543652 3月前

    The issue is still persisting in the versions from 4.8.0.1451.

    0xFFFFFFFFFFFFFFFF in System.Diagnostics.Debugger.Mono_UnhandledException_internal 0x1 in System.Diagnostics.Debugger.Mono_UnhandledException at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Diagnostics/Debugger.cs:125,4 0x33 in Android.Runtime.DynamicMethodNameCounter.45 0x144 in CarouselView.FormsPlugin.Android.CarouselViewRenderer.OnElementChanged 0xD3 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:245,4 0x3A in Xamarin.Forms.Platform.Android.VisualElementRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:135,4 0x21 in Xamarin.Forms.Platform.Android.Platform.CreateRenderer at D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:350,4 0xC4 in Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:140,6 0x176 in Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:351,6 0x8 in Xamarin.Forms.Platform.Android.VisualElementPackager.Load at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:112,4 0x8 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetPackager at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:470,4 0xF0 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:248,5 0x3A in Xamarin.Forms.Platform.Android.VisualElementRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:135,4 0x21 in Xamarin.Forms.Platform.Android.Platform.CreateRenderer at D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:350,4 0xC4 in Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:140,6 0x176 in Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:351,6 0x8 in Xamarin.Forms.Platform.Android.VisualElementPackager.Load at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:112,4 0x8 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetPackager at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:470,4 0xF0 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:248,5 0x3A in Xamarin.Forms.Platform.Android.VisualElementRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:135,4 0x21 in Xamarin.Forms.Platform.Android.Platform.CreateRenderer at D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:350,4 0xC4 in Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:140,6 0x176 in Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:351,6 0x8 in Xamarin.Forms.Platform.Android.VisualElementPackager.Load at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:112,4 0x8 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetPackager at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:470,4 0xF0 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:248,5 0x3A in Xamarin.Forms.Platform.Android.VisualElementRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:135,4 0x21 in Xamarin.Forms.Platform.Android.Platform.CreateRenderer at D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:350,4 0xC4 in Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:140,6 0x176 in Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:351,6 0x8 in Xamarin.Forms.Platform.Android.VisualElementPackager.Load at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:112,4 0x8 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetPackager at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:470,4 0xF0 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:248,5 0x3A in Xamarin.Forms.Platform.Android.VisualElementRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:135,4 0x21 in Xamarin.Forms.Platform.Android.Platform.CreateRenderer at D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:350,4 0xC4 in Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:140,6 0x176 in Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:351,6 0x8 in Xamarin.Forms.Platform.Android.VisualElementPackager.Load at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:112,4 0x8 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetPackager at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:470,4 0xF0 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:248,5 0x3A in Xamarin.Forms.Platform.Android.VisualElementRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:135,4 0x21 in Xamarin.Forms.Platform.Android.Platform.CreateRenderer at D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:350,4 0xC4 in Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:140,6 0x176 in Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:351,6 0x8 in Xamarin.Forms.Platform.Android.VisualElementPackager.Load at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:112,4 0x8 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetPackager at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:470,4 0xF0 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:248,5 0x3A in Xamarin.Forms.Platform.Android.VisualElementRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:135,4 0x21 in Xamarin.Forms.Platform.Android.Platform.CreateRenderer at D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:350,4 0x41 in Xamarin.Forms.Platform.Android.ScrollViewContainer.set_ChildView at D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewContainer.cs:35,6 0x11 in Xamarin.Forms.Platform.Android.ScrollViewRenderer.LoadContent at D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:373,4 0xD0 in Xamarin.Forms.Platform.Android.ScrollViewRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:103,5 0x21 in Xamarin.Forms.Platform.Android.Platform.CreateRenderer at D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:350,4 0xC4 in Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:140,6 0x176 in Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:351,6 0x8 in Xamarin.Forms.Platform.Android.VisualElementPackager.Load at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:112,4 0x8 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetPackager at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:470,4 0xF0 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:248,5 0x3A in Xamarin.Forms.Platform.Android.VisualElementRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:135,4 0x21 in Xamarin.Forms.Platform.Android.Platform.CreateRenderer at D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:350,4 0xC4 in Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:140,6 0x176 in Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:351,6 0x8 in Xamarin.Forms.Platform.Android.VisualElementPackager.Load at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:112,4 0x8 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetPackager at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:470,4 0xF0 in Xamarin.Forms.Platform.Android.VisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:248,5 0x3A in Xamarin.Forms.Platform.Android.VisualElementRenderer.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:135,4 0x33 in Xamarin.Forms.Platform.Android.Platform.CreateRenderer at D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:397,4 0x1B in Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnCreateView at D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FragmentContainer.cs:64,5 0x24 in AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ at D:\a\1\s\generated\androidx.fragment.fragment\obj\Release\monoandroid90\generated\src\AndroidX.Fragment.App.Fragment.cs:1876,4 0x23 in Android.Runtime.DynamicMethodNameCounter.45

    点赞 评论 复制链接分享
  • weixin_39943750 weixin_39943750 3月前

    I'm experiencing the same issue on upgrading xamarin forms to 4.5.0.356,(CarouselView.Forms Plugin(used version 5.2.0) results a NullReferenceException in Android). Any fix available? StackTraceScreenshot 2020-03-16 at 1 10 45 PM

    点赞 评论 复制链接分享
  • weixin_40006779 weixin_40006779 3月前

    Anyone found solution to fix the issue, because still replicating with latest Xamarin Forms version.

    点赞 评论 复制链接分享
  • weixin_39855658 weixin_39855658 3月前

    Anyone found solution to fix the issue, because still replicating with latest Xamarin Forms version.

    Can my comment be helpful? https://github.com/alexrainman/CarouselView/issues/557#issuecomment-593088783

    点赞 评论 复制链接分享
  • weixin_40006779 weixin_40006779 3月前

    Thanks for the reply. Yes, your comment will help, but it is not working on Android only and works very well on iOS. So, it would be nice if this issue resolved.

    点赞 评论 复制链接分享
  • weixin_39855658 weixin_39855658 3月前

    To me, it is working fine on both OS

    点赞 评论 复制链接分享
  • weixin_40006779 weixin_40006779 3月前

    I have updated the Xamarin.Forms to latest version i.e. 4.5. After that this plugin stopped working on Android. But it still works on iOS. So, if you have found any fix for this plugin it would help us.

    点赞 评论 复制链接分享
  • weixin_40006779 weixin_40006779 3月前

    560 - If we are using the CarouselView in ScrollView, we are able reproduce the issue.

    as you have mentioned that you have fixed the issue. Please let us know how to fix the issue.

    点赞 评论 复制链接分享
  • weixin_39669761 weixin_39669761 3月前

    Same error here. Update to last version of Xam forms and debug on Android 10

    点赞 评论 复制链接分享
  • weixin_39593460 weixin_39593460 3月前

    I am receiving this error as well on Android

    点赞 评论 复制链接分享
  • weixin_39974932 weixin_39974932 3月前

    Same here on Android Emulator (API 24) and Moto G5 Plus (API 28), so I just downgraded Xamarin Forms from 4.4.0.991265 to 4.3.0.991250 and it looks OK for now.

    点赞 评论 复制链接分享
  • weixin_39707168 weixin_39707168 3月前

    I am also getting perfect same error after I upgraded Xamarin Forms to 4.4.0.991265

    点赞 评论 复制链接分享
  • weixin_39669761 weixin_39669761 3月前

    Yes seems is not compatible with last version of Xamarin Forms, I need to downgrade to 4.2.2.x only for Android

    点赞 评论 复制链接分享
  • weixin_39754616 weixin_39754616 3月前

    Who can provide a demo project reproducing the issue so i can try with my latest code?

    点赞 评论 复制链接分享
  • weixin_39897449 weixin_39897449 3月前

    I get the crash as soon as I put the CarouselViewControl into a ScrollView using Xamarin Forms 4.4.0. It looks like #549 should fix it but I haven't tested that.

    I created a test project here to demonstrate, but the ScrollView is what it boils down to.

    点赞 评论 复制链接分享
  • weixin_39754616 weixin_39754616 3月前

    Why you need to put the Carousel into a ScrollView?

    点赞 评论 复制链接分享
  • weixin_39939276 weixin_39939276 3月前

    Why you need to put the Carousel into a ScrollView?

    In my case, I have content below the carousel view that requires vertical scrolling.

    点赞 评论 复制链接分享
  • weixin_39897449 weixin_39897449 3月前

    Thanks for the pointer to the Forms built-in CarouselView.

    I also have content below the carousel that the user has to scroll to see. It looks like this change is what's causing issues.

    点赞 评论 复制链接分享
  • weixin_39631350 weixin_39631350 3月前

    Why you need to put the Carousel into a ScrollView?

    In my case, I have content below the carousel view that requires vertical scrolling.

    Does anyone have a workaround before updating?

    点赞 评论 复制链接分享
  • weixin_39769984 weixin_39769984 3月前

    Here is the stack trace I am getting if anyone needs it. Anyone found a workaround yet?

    
    Exception Type : System.NullReferenceException
    Message : Object reference not set to an instance of an object.
    Source : mscorlib
    Data : No Data
    HelpLink : No HelpLink
    HResult  : -2147467261
    
    at CarouselView.FormsPlugin.Android.CarouselViewRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1[TElement] e) [0x00132] in <892bb6a09e5d43ddbe9591d58bbf4c0e>:0
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000b8] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:231
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
    at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138
    at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334
    at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
    at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138
    at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334
    at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
    at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138
    at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334
    at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
    at Xamarin.Forms.Platform.Android.ScrollViewContainer.set_ChildView (Xamarin.Forms.View value) [0x0002f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewContainer.cs:37
    at Xamarin.Forms.Platform.Android.ScrollViewRenderer.LoadContent () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:364
    at Xamarin.Forms.Platform.Android.ScrollViewRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x000cf] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:97
    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
    at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138
    at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334
    at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
    at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138
    at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334
    at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
    at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138
    at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334
    at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
    at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138
    at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334
    at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
    at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000af] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:138
    at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00139] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:334
    at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:110
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:440
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000d5] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:128
    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0001f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:344
    at Xamarin.Forms.Platform.Android.AppCompat.Platform+ModalContainer..ctor (Android.Content.Context context, Xamarin.Forms.Page modal) [0x00031] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:435
    at Xamarin.Forms.Platform.Android.AppCompat.Platform.PresentModal (Xamarin.Forms.Page modal, System.Boolean animated) [0x0000d] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:389
    at Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms.INavigation.PushModalAsync (Xamarin.Forms.Page modal, System.Boolean animated) [0x00055] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:164
    at Xamarin.Forms.Application+NavigationImpl.OnPushModal (Xamarin.Forms.Page modal, System.Boolean animated) [0x0007d] in D:\a\1\s\Xamarin.Forms.Core\Application.cs:398
    at Prism.Navigation.PageNavigationService+<>c__DisplayClass41_0.<processnavigationforcontentpage>b__0 () [0x0003c] in d:\a\1\s\Source\Xamarin\Prism.Forms\Navigation\PageNavigationService.cs:492
    at Prism.Navigation.PageNavigationService.DoNavigateAction (Xamarin.Forms.Page fromPage, System.String toSegment, Xamarin.Forms.Page toPage, Prism.Navigation.INavigationParameters parameters, System.Func`1[TResult] navigationAction, System.Action`1[T] onNavigationActionCompleted) [0x00143] in d:\a\1\s\Source\Xamarin\Prism.Forms\Navigation\PageNavigationService.cs:704
    at Prism.Navigation.PageNavigationService.ProcessNavigationForContentPage (Xamarin.Forms.Page currentPage, System.String nextSegment, System.Collections.Generic.Queue`1[T] segments, Prism.Navigation.INavigationParameters parameters, System.Nullable`1[T] useModalNavigation, System.Boolean animated) [0x001a1] in d:\a\1\s\Source\Xamarin\Prism.Forms\Navigation\PageNavigationService.cs:490
    at Prism.Navigation.PageNavigationService.ProcessNavigation (Xamarin.Forms.Page currentPage, System.Collections.Generic.Queue`1[T] segments, Prism.Navigation.INavigationParameters parameters, System.Nullable`1[T] useModalNavigation, System.Boolean animated) [0x001ca] in d:\a\1\s\Source\Xamarin\Prism.Forms\Navigation\PageNavigationService.cs:365
    at Prism.Navigation.PageNavigationService.NavigateInternal (System.Uri uri, Prism.Navigation.INavigationParameters parameters, System.Nullable`1[T] useModalNavigation, System.Boolean animated) [0x000f9] in d:\a\1\s\Source\Xamarin\Prism.Forms\Navigation\PageNavigationService.cs:322
    </processnavigationforcontentpage>
    点赞 评论 复制链接分享
  • weixin_39631350 weixin_39631350 3月前

    Xamarin Forms 4.4.0.991537 and CarouselView.Forms Plugin 5.0.2 version gives problem-free results in scroolview. Good work.

    点赞 评论 复制链接分享
  • weixin_39807352 weixin_39807352 3月前

    Any idea when this is going to be fixed?

    点赞 评论 复制链接分享
  • weixin_39855658 weixin_39855658 3月前

    I've ended up using the new official Xamarin.Forms.CarouselView. It is available since 4.4 and the synthax is pretty identical to the one used by this plugin.

    点赞 评论 复制链接分享
  • weixin_39939276 weixin_39939276 3月前

    I'm seeing the exact same issue with an identical stack trace as well when upgrading to Xamarin.Forms 4.4.0.991265.

    点赞 评论 复制链接分享
  • weixin_39939276 weixin_39939276 3月前

    I can't say for sure, but looking at the stack traces and code I'm thinking that pull request #549 might fix this issue. It's been open since Oct.

    点赞 评论 复制链接分享
  • weixin_39717110 weixin_39717110 3月前

    I can confirm, that #549 is the solution for this. But when I compile a new version I get a NullReferenceException at line 420 of CarouselViewImplementation

    void SetNativeView()
    {
        if (orientationChanged)
        {
            var inflater = AViews.LayoutInflater.From(_context);
    
            // Orientation BP
            if (Element.Orientation == CarouselViewOrientation.Horizontal)
                nativeView = inflater.Inflate(Resource.Layout.horizontal_viewpager, null);
            else
                nativeView = inflater.Inflate(Resource.Layout.vertical_viewpager, null);
    
            //  -- > Will return null. Why? (Resource.Id.pager);
    
            orientationChanged = false;
        }
        viewPager.Adapter = new PageAdapter(Element);
    

    Steps to reproduce

    • Clone repository and build
    • Implement fix from #549
    • Rebuild solution
    • Reference libs in own project with Xamarin 4.4.0.991265
    • Debug
    点赞 评论 复制链接分享
  • weixin_39939276 weixin_39939276 3月前

    I ended up porting over to the new built-in Xamarin Forms CarouselView and the new (but experimental) IndicatorView.

    The Interfaces are very similar to this library so the code changes were pretty minimal. They perform functionally the same from what I can tell. I think I'm just going to stick with the new built-in stuff for now because I can't afford to be blocked.

    点赞 评论 复制链接分享
  • weixin_39754616 weixin_39754616 3月前

    I will take a look at this before releasing a new version.

    点赞 评论 复制链接分享
  • weixin_39754616 weixin_39754616 3月前

    I cannot reproduce this in my latest code. It just work out of the box without fix #549

    点赞 评论 复制链接分享

为你推荐