CardView: System.NullReferenceException Galaxy S8+ (Android 9)

Device: Samsung S8+ Android Version: 9 Xamarin.Forms: 4.0.0.425677 CardsView: 2.1.3

Hi,

im trying to use the CarouselView and get a NullReferenceException.

<cards:CarouselView x:Name="Carousel"
				HeightRequest="400"
				ItemsSource="{Binding Highlights}"
				UserInteracted="Carousel_UserInteracted">
		<cards:CarouselView.ItemTemplate>
			<DataTemplate>
				<datatemplates:HighlightDataTemplate Command="{Binding Source={x:Reference Root}, Path=BindingContext.HighlightSelectedCommand}" />
			</DataTemplate>
		</cards:CarouselView.ItemTemplate>
	<cards1:IndicatorsControl />
</cards:CarouselView>
<datatemplates:BaseDataTemplate x:Class="Shop.Client.Mobile.Views.DataTemplates.HighlightDataTemplate"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:datatemplates="clr-namespace:Shop.Client.Mobile.Views.DataTemplates"
xmlns:ffimageloading="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
xmlns:forms="clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms"
BackgroundColor="White">

	<Grid Margin="10,10,10,0"
		  HorizontalOptions="FillAndExpand">

		<ffimageloading:CachedImage x:Name="BackgroundImage"
									Grid.RowSpan="2"
									Aspect="AspectFill"
									BitmapOptimizations="True"
									DownsampleUseDipUnits="True"
									Source="{Binding Image}" />

		<StackLayout Grid.Row="1"
					 Margin="15,0,0,30"
					 VerticalOptions="End">
			<Label x:Name="xTextblockTitle"
				   FontFamily="{StaticResource RobotoBold}"
				   FontSize="35"
				   Text="{Binding Title}"
				   TextColor="{Binding TextColor, Converter={StaticResource ToColorConverter}}" />

			<Label x:Name="xTextblockText"
				   FontFamily="{StaticResource RobotoRegular}"
				   FontSize="18"
				   LineBreakMode="WordWrap"
				   Text="{Binding Text}"
				   TextColor="{Binding TextColor, Converter={StaticResource ToColorConverter}}" />
		</StackLayout>

		<Grid.GestureRecognizers>
			<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped" />
		</Grid.GestureRecognizers>
	</Grid>
</datatemplates:BaseDataTemplate>
private void Carousel_UserInteracted(PanCardView.CardsView view, PanCardView.EventArgs.UserInteractedEventArgs args) {

	if (args.Status == PanCardView.Enums.UserInteractionStatus.Started) {
		_baseTabbedPage?.DisableSwipe();
	}

	if (args.Status == PanCardView.Enums.UserInteractionStatus.Ended) {
		_baseTabbedPage?.EnableSwipe();
	}
}

Stacktrace:

at PanCardView.CardsView.OnTouchChanged (System.Double diff) [0x0004a] in <700898b22b8841319843af84bd531650>:0
at PanCardView.CardsView.OnPanUpdated (Xamarin.Forms.PanUpdatedEventArgs e) [0x0005b] in <700898b22b8841319843af84bd531650>:0 
at PanCardView.Droid.CardsViewRenderer.UpdatePan (Xamarin.Forms.GestureStatus status, System.Double totalX, System.Double totalY) [0x0000f] in <d9849d6397d843e4839721848b153844>:0 
at PanCardView.Droid.CardsViewRenderer.HandleUpCancelEvent (Android.Views.MotionEvent ev) [0x00031] in <d9849d6397d843e4839721848b153844>:0
at PanCardView.Droid.CardsViewRenderer.HandleDownUpEvents (Android.Views.MotionEvent ev) [0x00007] in <d9849d6397d843e4839721848b153844>:0
at PanCardView.Droid.CardsViewRenderer.OnTouchEvent (Android.Views.MotionEvent e) [0x00058] in <d9849d6397d843e4839721848b153844>:0
at Android.Views.View.n_OnTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x00011] in <a6696dd5fce04f5480364911ef1529f2>:0 
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.29(intptr,intptr,intptr)\n--- End of stack trace from previous location where exception was thrown
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualBooleanMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
Android.Views.View.DispatchTouchEvent (Android.Views.MotionEvent e) [0x00031] in <a6696dd5fce04f5480364911ef1529f2>:0
Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].DispatchTouchEvent (Android.Views.MotionEvent e) [0x00012] in <b38d874641c84b3bb71f601f5308c6a1>:0
Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x00011] in <a6696dd5fce04f5480364911ef1529f2>:0 \n at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.31(intptr,intptr,intptr)\n--- End of stack trace from previous location where exception was thrown 
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualBooleanMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
at Android.Views.View.DispatchTouchEvent (Android.Views.MotionEvent e) [0x00031] in <a6696dd5fce04f5480364911ef1529f2>:0 
at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].DispatchTouchEvent (Android.Views.MotionEvent e) [0x00012] in <b38d874641c84b3bb71f601f5308c6a1>:0 
at Xamarin.Forms.Platform.Android.Platform+DefaultRenderer.DispatchTouchEvent (Android.Views.MotionEvent e) [0x00007] in <b38d874641c84b3bb71f601f5308c6a1>:0 
at Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x00011] in <a6696dd5fce04f5480364911ef1529f2>:0 
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.31(intptr,intptr,intptr)
End of stack trace from previous location where exception was thrown 
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualBooleanMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0 
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
at Android.Views.View.DispatchTouchEvent (Android.Views.MotionEvent e) [0x00031] in <a6696dd5fce04f5480364911ef1529f2>:0
at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].DispatchTouchEvent (Android.Views.MotionEvent e) [0x00012] in <b38d874641c84b3bb71f601f5308c6a1>:0 
at Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x00011] in <a6696dd5fce04f5480364911ef1529f2>:0 
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.31(intptr,intptr,intptr)\n--- End of stack trace from previous location where exception was thrown 
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualBooleanMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0 
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
at Android.Views.View.DispatchTouchEvent (Android.Views.MotionEvent e) [0x00031] in <a6696dd5fce04f5480364911ef1529f2>:0 \n at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].DispatchTouchEvent (Android.Views.MotionEvent e) [0x00012] in <b38d874641c84b3bb71f601f5308c6a1>:0 \n at Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x00011] in <a6696dd5fce04f5480364911ef1529f2>:0 
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.31(intptr,intptr,intptr)\n--- End of stack trace from previous location where exception was thrown 
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualBooleanMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
at Android.Views.View.DispatchTouchEvent (Android.Views.MotionEvent e) [0x00031] in <a6696dd5fce04f5480364911ef1529f2>:0
at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].DispatchTouchEvent (Android.Views.MotionEvent e) [0x00012] in <b38d874641c84b3bb71f601f5308c6a1>:0
at Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x00011] in <a6696dd5fce04f5480364911ef1529f2>:0 
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.31(intptr,intptr,intptr)\n--- End of stack trace from previous location where exception was thrown 
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualBooleanMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0 
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0 
at Android.Views.View.DispatchTouchEvent (Android.Views.MotionEvent e) [0x00031] in <a6696dd5fce04f5480364911ef1529f2>:0 
at Xamarin.Forms.Platform.Android.PlatformRenderer.DispatchTouchEvent (Android.Views.MotionEvent e) [0x00035] in <b38d874641c84b3bb71f601f5308c6a1>:0
at Android.Views.View.n_DispatchTouchEvent_Landroid_view_MotionEvent_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_e) [0x00011] in <a6696dd5fce04f5480364911ef1529f2>:0 
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.31(intptr,intptr,intptr)


About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 37 (19 by maintainers)

Commits related to this issue

Most upvoted comments

@AndreiMisiukevich , I hope it is not coming in v2.1.5. I didnt get any of them yet