'Xamarin forms android throw null exception after updating Xamarin forms to 5.0.0.2401

I have updated Xamarin Forms to latest version(5.0.0.2401). It is working fine in iOS. In android first it returns Error: Could not find 2 Android X assemblies, make sure to install the following NuGet packages: - Xamarin.AndroidX.MediaRouter, Xamarin.AndroidX.Palette. After that I have added these 2 packages. Now It will debug without error but it does not deploy in android. It returns System.NullReferenceException has been thrown Object reference not set to an instance of an object error and in stack trace it returns the following error.

at Android.Runtime.JNINativeWrapper._unhandled_exception (System.Exception e) [0x0000e] in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:12 at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V (_JniMarshal_PPL_V callback, System.IntPtr jnienv, System.IntPtr klazz, System.IntPtr p0) [0x0001d] in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:111 at (wrapper native-to-managed) Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V(intptr,intptr,intptr).

Target Android version - v10.0

Please help to fix this issue.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source