react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

[Android] App Crash when use (split-screen, multi-window, popup-window) feature on android5+

Open buffaly opened this issue 9 years ago • 4 comments

App crash when try to use (split-screen, multi-window, popup-window) feature on android5+ However, I disable this feature on androidManifest.xml but It does not fix this crash.

  • react: 16.1.1
  • react-native: 0.49.5
  • react-native-navigation: 1.1.281

In my opinion, Maybe activity try to resume app but don't found something to display or lose something before that I have no idea how to fix it out.

Logcat allow split screen

 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
 	at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4754)
 	at android.app.ActivityThread.-wrap18(Unknown Source:0)
 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1599)
 	at android.os.Handler.dispatchMessage(Handler.java:105)
 	at android.os.Looper.loop(Looper.java:164)
 	at android.app.ActivityThread.main(ActivityThread.java:6541)
 	at java.lang.reflect.Method.invoke(Native Method)
 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Bundle android.os.Bundle.getBundle(java.lang.String)' on a null object reference
 	at com.reactnativenavigation.params.AppStyle.setAppStyle(AppStyle.java:11)
 	at com.reactnativenavigation.params.parsers.ActivityParamsParser.parse(ActivityParamsParser.java:14)
 	at com.reactnativenavigation.controllers.NavigationCommandsHandler.parseActivityParams(NavigationCommandsHandler.java:32)
 	at com.reactnativenavigation.controllers.NavigationActivity.onCreate(NavigationActivity.java:72)
 	at android.app.Activity.performCreate(Activity.java:6975)
 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
 	... 10 more

disable split screen on androidManifest.xml

android.view.WindowLeaked: Activity com.reactnativenavigation.controllers.NavigationActivity has leaked window DecorView@8603df1[] that was originally added here
	at android.view.ViewRootImpl.<init>(ViewRootImpl.java:485)
	at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:346)
	at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:92)
	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3734)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2898)
	at android.app.ActivityThread.-wrap11(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
	at android.os.Handler.dispatchMessage(Handler.java:105)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6541)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

buffaly avatar Nov 19 '17 18:11 buffaly

Any workaround? I have the same error but without using split-screen, multi-window, popup-window, etc. It just crashes all of a sudden.

Android emulator API 22. react-native 0.52 (wasn't happening on 0.49.5)

brunolemos avatar Feb 01 '18 00:02 brunolemos

Fix for WindowLeaked was mentioned at this issue

Add this method:

    @Override
    protected void onPause() {
        SplashScreen.hide(this);
        super.onPause();
    }

brunolemos avatar Feb 01 '18 07:02 brunolemos

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

stale[bot] avatar Jun 02 '18 07:06 stale[bot]

The issue has been closed for inactivity.

stale[bot] avatar Jun 09 '18 07:06 stale[bot]