Skip to content

FormsAppCompatActivity.OnDestroy occasionally throws "No view found for id" exception for Android N devices #1143

Closed

Description

@peteschmitz

Steps to Reproduce

I could not reproduce this from our development environment. We've received infrequent and non-critical reports from our bug reporting.

Expected Behavior

  • App gracefully closes

Actual Behavior

  • App crashes with the below exception

Version Information

Affected Form versions:
2.4.0.38779
2.5.0.91635

Affected Device Platforms:
Android N (7.x)

Affected Devices:
Galaxy S7, S7 Edge, S8, S8+
Galaxy Note 5
LG Aristo, G6, Stylo 3

Related

Stacktrace

Java.Interop.JniEnvironment No view found for id 0x1 (unknown) for fragment FragmentContainer{460ecc1 #1 id=0x1}
Raw
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()<b5f2483a551b45a99f04c68f14fc2c14>:0
Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod(JniObjectReference instance, JniObjectReference type, JniMethodInfo method, JniArgumentValue* args)<eba4edc4e27949518f7bf237cb1196cc>:0
Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod(string encodedMember, IJavaPeerable self, JniArgumentValue* parameters)<eba4edc4e27949518f7bf237cb1196cc>:0
Android.App.Activity.OnDestroy()<bec3773976364d6f966ebdab5e7a8df3>:0
Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy()<8d6936257ac5419f8be9df07a9bb5129>:0
iSurvey.Android.MainActivity.OnDestroy()<8d9b18b497204292ba1e24a705032810>:0
Android.App.Activity.n_OnDestroy(IntPtr jnienv, IntPtr native__this)<bec3773976364d6f966ebdab5e7a8df3>:0
at (wrapper dynamic-method) System.Object:ee7a2513-7ba6-47d4-b295-16c9cfe08d94 (intptr,intptr)
--- End of managed Java.Lang.IllegalArgumentException stack trace ---
java.lang.IllegalArgumentException: No view found for id 0x1 (unknown) for fragment FragmentContainer{460ecc1 #1 id=0x1}
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1334)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1569)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1636)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2415)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2201)
at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2155)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2064)
at android.support.v4.app.FragmentManagerImpl.dispatchDestroy(FragmentManager.java:3026)
at android.support.v4.app.FragmentController.dispatchDestroy(FragmentController.java:262)
at android.support.v4.app.FragmentActivity.onDestroy(FragmentActivity.java:390)
at android.support.v7.app.AppCompatActivity.onDestroy(AppCompatActivity.java:209)
iSurvey.Android.MainActivity.n_onDestroy(Native Method)
at iSurvey.Android.MainActivity.onDestroy(MainActivity.java:114)
at android.app.Activity.performDestroy(Activity.java:6959)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1154)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4289)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4320)
at android.app.ActivityThread.-wrap6(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6310)
java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)

Activity

  1. jonpryor commented on Jan 2, 2018

    @jonpryor
    Contributor
  2. mr5z commented on Jan 3, 2018

    @mr5z

    Why was this issue closed?

  3. jonpryor commented on Jan 3, 2018

    @jonpryor
    Contributor

    @mr5z: Because this appears to be a Xamarin.Forms issue, and there's nothing to do to fix it here. Hence, "moved".

  4. added a commit that references this issue on Jan 23, 2021
  5. ghost locked as resolved and limited conversation to collaborators on Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions