question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System.NullReferenceException Galaxy S8+ (Android 9)

See original GitHub issue

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)


Issue Analytics

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

github_iconTop GitHub Comments

1reaction
PaulsonMcommented, Jun 26, 2019

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

0reactions
PaulsonMcommented, Jun 27, 2019

@AndreiMisiukevich , I figured out the problem on my side - thanks very much…! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

.net - NullReferenceException in System.Threading.Tasks. ...
This Microsoft paper shows how to target an app to one or more Android-supported CPU architectures. You may need to target multiple ...
Read more >
Samsung S8/S8+ TWRP & Root / Magisk Guide - XDA Forums
Flashing completed but Magisk Manager keeps saying not rooted. Tried following the official Samsung Android 9.0 guide here https://topjohnwu.
Read more >
How to Check Android Version on Samsung Galaxy S8
Check more information about Samsung Galaxy S8 : https://www.hardreset.info/devices/samsung/samsung-g950f- galaxy - s8 / Hi there!
Read more >
My galaxy s8 didn't get the android 9 update yet : r/GalaxyS8
My galaxy s8 didn't get the android 9 update yet. My phone is still an android 8.0.0 and i don't get the notifications...
Read more >
How to Boot Your Galaxy S8 or S8+ into Recovery Mode ...
Samsung devices have two pre-boot menus that every Galaxy owner should know about: recovery mode and download mode.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found