0

I'm using Xamarin.Forms and Developing Android and iOS app.

After many changes in Solution and trying to run again, I get an Exception in the project. When I monitor error in Device Log(logcat) I found the following error:

android.runtime.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an object at Xamarin.Forms.Platform.Android.AppCompat.Platform.LayoutRootPage (Xamarin.Forms.Page page, System.Int32 width, System.Int32 height) [0x00034] in <99988d4ab8d144898ef5bc7586876d75>:0 at Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms.Platform.Android.IPlatformLayout.OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x0000a] in <99988d4ab8d144898ef5bc7586876d75>:0 at Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x00018] in <99988d4ab8d144898ef5bc7586876d75>:0 at Android.Views.ViewGroup.n_OnLayout_ZIIII (System.IntPtr jnienv, System.IntPtr native__this, System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x00009] in :0 at (wrapper dynamic-method) System.Object.28(intptr,intptr,bool,int,int,int,int) at md51558244f76c53b6aeda52c8a337f2c37.PlatformRenderer.n_onLayout(Native Method) at md51558244f76c53b6aeda52c8a337f2c37.PlatformRenderer.onLayout(PlatformRenderer.java:63) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678) at android.view.View.layout(View.java:16630) at android.view.ViewGroup.layout(ViewGroup.java:5437) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2171) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1931) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858) at android.view.Choreographer.doCallbacks(Choreographer.java:670) at android.view.Choreographer.doFrame(Choreographer.java:606) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Force finishing activity myProject.Droid/md5f53602fc1a8a73c5233d31ad62e08ff9.MainActivity Force finishing activity myProject.Droid/md5f53602fc1a8a73c5233d31ad62e08ff9.SplashActivity

How I can found where the exception fire? In this message, not anythings clear.

Thanks, everyone for taking the time to try and help explain

Rui Jarimba
  • 9,732
  • 10
  • 46
  • 74
Saeid Mirzaei
  • 582
  • 1
  • 10
  • 31
  • 3
    Possible duplicate of [What is a NullReferenceException, and how do I fix it?](https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – Llama Oct 27 '18 at 04:38
  • Actually, I know what is that mean, but I can't found It. Thanks for sharing the link. I saw that before ask question. – Saeid Mirzaei Oct 27 '18 at 04:44
  • Remove everything from the page until it works, the slowly add everything back – TheGeneral Oct 27 '18 at 05:47
  • I think it's soo hard and complicated way, I'm looking for a better way. Thanks @TheGeneral – Saeid Mirzaei Oct 27 '18 at 05:51
  • But how we supposed to help, we cant see any of your code? – TheGeneral Oct 27 '18 at 05:52
  • I'm looking for a tools like logcat for more information about my exception. my project contains a lot of files, so I don't know which part of the code should be shared. @TheGeneral – Saeid Mirzaei Oct 27 '18 at 05:58

0 Answers0