react-native-splash-screen icon indicating copy to clipboard operation
react-native-splash-screen copied to clipboard

android.view.WindowLeaked ?

Open zabojad opened this issue 5 years ago • 9 comments

This lib is generating the following errors in logcat:

12-10 17:41:28.443 27325-27325/com.myapp E/WindowManager: android.view.WindowLeaked: Activity com.myapp.MainActivity has leaked window DecorView@ce4351b[] that was originally added here
        at android.view.ViewRootImpl.<init>(ViewRootImpl.java:614)
        at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:365)
        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:100)
        at android.app.Dialog.show(Dialog.java:420)
        at org.devio.rn.splashscreen.SplashScreen$1.run(SplashScreen.java:36)
        at android.app.Activity.runOnUiThread(Activity.java:6281)
        at org.devio.rn.splashscreen.SplashScreen.show(SplashScreen.java:27)
        at org.devio.rn.splashscreen.SplashScreen.show(SplashScreen.java:49)
        at org.devio.rn.splashscreen.SplashScreen.show(SplashScreen.java:56)
        at com.myapp.MainActivity.onCreate(MainActivity.java:21)
        at android.app.Activity.performCreate(Activity.java:7183)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6938)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

However, the splashscreen shows up correctly and everything seems to work fine. Any idea why does this get logged?

My env:

"react": "16.5.0",
"react-native": "0.57.0",
"react-native-splash-screen": "^3.1.1",

zabojad avatar Dec 10 '18 16:12 zabojad

@crazycodeboy any updates on this ? getting the same error. please help

sumesh1993 avatar Jan 14 '19 18:01 sumesh1993

This error crashes my app when built for release, I have no issues when debugging. Does anyone have any clues? I really need this fixed ASAP.

baldursson avatar Jan 21 '19 09:01 baldursson

In my case i have commented this code ndk { abiFilters "armeabi-v7a", "x86" }

add these ndk filter and if you have commented or removed

React Native on Android doesn't provide a 64-bit version of the libreactnativejni.so native library, which can cause compatibility issues on 64-bit devices. I ran into this while attempting to integrate React Native with a large existing application I'm developing.

bandhiwal avatar Jan 24 '19 12:01 bandhiwal

+1

mtx62 avatar Feb 14 '19 17:02 mtx62

@baldursson Hi, were you able to resolve this issue? My app is crashing on release build like yours.

SkyTreasure avatar Mar 28 '19 12:03 SkyTreasure

@SkyTreasure Somehow I did, but I sadly can't remember how. Looking through my commit history at the time, I can't see any updates to the actual project that might have fixed it, to I guess it had something to do with external factors. Sometimes simply deleting and re-installing node_modules fixes the weirdest problems.

baldursson avatar Apr 02 '19 08:04 baldursson

Adding ndk node solve the crash on release. But if want to build split APKs another issue will come, conflicting configuration: ndk abiFilters cannot be present when splits abi filters are set, and wont build. This is portion of my app/build.gradle:

defaultConfig {
    ...
    ndk {
      abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
    }
    ...
}
splits {
    abi {
        reset()
        enable true
        universalApk true
        include 'armeabi-v7a','arm64-v8a','x86','x86_64'
    }
}

Any idea on how to fix this? @bandhiwal @baldursson

willymulyana avatar Jun 13 '19 01:06 willymulyana

same here.

BiplovQss avatar Nov 27 '20 12:11 BiplovQss

put android:largeHeap="true" this in your android manifest file image i solved window leak issue using this

iamnoorsk avatar Apr 30 '24 09:04 iamnoorsk