React-native-splash-screen: Activity <app_id>.MainActivity has leaked window DecorView@12690ea[MainActivity] that was originally added here

Created on 10 Apr 2019  Â·  14Comments  Â·  Source: crazycodeboy/react-native-splash-screen

Getting this message on Android, version 3.2.0. Any idea?

Stack trace:
image

Most helpful comment

Downgrading toreact-native-splash-screen version ^3.0.1 fixed the issue for me.

All 14 comments

My MainActivity.java:

public class MainActivity extends SplashActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        SplashScreen.show(this);
        super.onCreate(savedInstanceState);
    }

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

@oferRounds Still this issue exists, I have checked many a times in some devices it is crashing...

@crazycodeboy , Plz do suggest us resolve this issue...

Same issue with last version of react native 0.59.3 but only on release, it's working on dev

yes, we are also on 0.59.*

I've found a solution, this problem is an edge effect to another problem, if you check your adb logcat, you can see another error, in my case, an issue with index.bundle.js file

See this #32 thread for resolve your issue.

Great! But do you see any solution? Looking there don’t see something concrete

In my case this command was the solution:

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

If after that you have duplicate ressources, delete all content of drawable directories

What does this command do? Not sure this is my problem

This command recreate the index.bundle.js file. I repeat this error is a consequence of another error. In my case the index.bundle.js file. Check your adb logcat

logcat with latest react-native and react-native-splash-screen
-05 09:32:11.535 7093 7128 I CrashlyticsCore: Crashlytics report upload complete: 5CF7D26203D5-0001-1BB5-3A16E97ABDF6 06-05 09:32:11.616 2660 2905 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer... 06-05 09:32:11.660 7093 7093 E WindowManager: 06-05 09:32:11.660 7093 7093 E WindowManager: android.view.WindowLeaked: Activity com.subsite.utiliguard.MainActivity has leaked window DecorView@fb03f9b[] that was originally added here 06-05 09:32:11.660 7093 7093 E WindowManager: at android.view.ViewRootImpl.<init>(ViewRootImpl.java:485) 06-05 09:32:11.660 7093 7093 E WindowManager: at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:346) 06-05 09:32:11.660 7093 7093 E WindowManager: at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:92) 06-05 09:32:11.660 7093 7093 E WindowManager: at android.app.Dialog.show(Dialog.java:330) 06-05 09:32:11.660 7093 7093 E WindowManager: at org.devio.rn.splashscreen.SplashScreen$1.run(SplashScreen.java:36) 06-05 09:32:11.660 7093 7093 E WindowManager: at android.app.Activity.runOnUiThread(Activity.java:6152) 06-05 09:32:11.660 7093 7093 E WindowManager: at org.devio.rn.splashscreen.SplashScreen.show(SplashScreen.java:27) 06-05 09:32:11.660 7093 7093 E WindowManager: at org.devio.rn.splashscreen.SplashScreen.show(SplashScreen.java:49) 06-05 09:32:11.660 7093 7093 E WindowManager: at com.subsite.utiliguard.MainActivity.onCreate(MainActivity.java:34) 06-05 09:32:11.660 7093 7093 E WindowManager: at android.app.Activity.performCreate(Activity.java:6975) 06-05 09:32:11.660 7093 7093 E WindowManager: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213) 06-05 09:32:11.660 7093 7093 E WindowManager: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770) 06-05 09:32:11.660 7093 7093 E WindowManager: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) 06-05 09:32:11.660 7093 7093 E WindowManager: at android.app.ActivityThread.-wrap11(Unknown Source:0) 06-05 09:32:11.660 7093 7093 E WindowManager: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) 06-05 09:32:11.660 7093 7093 E WindowManager: at android.os.Handler.dispatchMessage(Handler.java:105) 06-05 09:32:11.660 7093 7093 E WindowManager: at android.os.Looper.loop(Looper.java:164) 06-05 09:32:11.660 7093 7093 E WindowManager: at android.app.ActivityThread.main(ActivityThread.java:6541) 06-05 09:32:11.660 7093 7093 E WindowManager: at java.lang.reflect.Method.invoke(Native Method) 06-05 09:32:11.660 7093 7093 E WindowManager: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 06-05 09:32:11.660 7093 7093 E WindowManager: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

I have this problem too but I cant solve that

I have this problem too, did anyone find a solution ?

Downgrading toreact-native-splash-screen version ^3.0.1 fixed the issue for me.

Was this page helpful?
0 / 5 - 0 ratings