Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android crash on back navigation while HandMotionAnimation is visible #95

Open
nickolanack opened this issue Dec 28, 2019 · 1 comment

Comments

@nickolanack
Copy link
Collaborator

nickolanack commented Dec 28, 2019

seems to consistently crash on a back navigation while the hand motion animation (detect a plane) is visible. this is not an issue for FaceDetection, or ImageDetection modes

System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getWidth()' on a null object reference
System.err: 	at com.google.ar.sceneform.ux.HandMotionAnimation.applyTransformation(HandMotionAnimation.java:48)

Android Pixel2 (Android 10)

@nickolanack
Copy link
Collaborator Author

I fixed the issue in my application by adding following snippet. (added in my app on page events)

beforeDisposeNativeViewNavigation(){
    //let _fragment=ar.getFragment();
    _fragment.getPlaneDiscoveryController().hide();
    _fragment.getPlaneDiscoveryController().setInstructionView(null);
}

I'm not sure exactly how this would be added to ar.android.ts - it needs to be executed before the page transition occurs (disposeNativeView happens after navigation )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant