title: Xamarin "attempt to invoke virtual method 'void android.view.View.unFocus (android.view.View)' on a null object reference"
body: <p>I am developing an app using Xamarin.Forms for cross platform use. Recently I updated Xamarin Studio on Mac along with updating NuGet Packages. </p>
  
  <p>I am now recieving this error: attempt to invoke virtual method 'void android.view.View.unFocus (android.view.View)' on a null object reference. (See stack trace below)</p>
  
  <p>This occurs when navigating away from (or re-rendering) any page except the root view. I don't believe I've changed any part of my navigation or page rendering. </p>
  
  <p>I'm sorry if this somewhat vague, it appears from the stack trace that this isn't starting from my code (in any traceable way). And I'm not sure where to begin debugging. Any advice would be very helpful!</p>
  
  <p>Stack Trace</p>
  
  <pre><code>--- End of managed Java.Lang.NullPointerException stack trace ---
  java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.unFocus(android.view.View)' on a null object reference
      at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4937)
      at android.view.ViewGroup.removeViewAt(ViewGroup.java:4899)
      at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1540)
      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
      at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:757)
      at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2355)
      at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2146)
      at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2098)
      at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2008)
      at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:710)
      at android.os.Handler.handleCallback(Handler.java:739)
      at android.os.Handler.dispatchMessage(Handler.java:95)
      at android.os.Looper.loop(Looper.java:158)
      at android.app.ActivityThread.main(ActivityThread.java:7224)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
  </code></pre>
  
  <p>EDIT: This only occurs on Android.</p>
  
  <p>EDIT: Additional information:
  This occurs mainly when a call to Navigation.PushAsync or Navigation.PopAsync (including user back button press).</p>
  
  <p>Here is the simplest example of this occurring in my app:
  Starting from the home screen, the user can take action to lead to a QR code scanning page. This QR code contains information on what load this driver will be delivering. After scanning, I save the information and pop the scanning page from navigation and then automatically push them to a loading screen. After the data loads I push them to a list of the information they need. (So now the navigation stack has [main, loading_screen, list_view]) If at this point any Navigation.PopAsync (or PushAsync) is called then the app crashes.  </p>