java.lang.RuntimeException at com.android.internal.os.ZygoteInit.main Xamarin Forms
My Xamarin Forms applications were crashing after a certain amount of activity and time using other apps with the following crash reports in google play console.
java.lang.RuntimeException:
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
Caused by: java.lang.reflect.InvocationTargetException:
at java.lang.reflect.Method.invoke(Native Method:0)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
My solution : I had two activities one splash/launch activity and a main activity.
I was calling forms init in the launch activity, therefore it was not being called each time the app resumes therefore you must move the initialization to the main activity OnCreate method and remove from launch activity.
Xamarin.Forms.Forms.Init(this, bundle);//Must be in main activity OnCreate not splash
No comments: