crazycodeboy / react-native-splash-screen

A splash screen for react-native, hide when application loaded ,it works on iOS and Android.
MIT License
5.61k stars 1.1k forks source link

android.view.WindowLeaked ? #336

Open zabojad opened 5 years ago

zabojad commented 5 years ago

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",
sumesh1993 commented 5 years ago

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

baldursson commented 5 years ago

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.

bandhiwal commented 5 years ago

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.

mtx62 commented 5 years ago

+1

SkyTreasure commented 5 years ago

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

baldursson commented 5 years ago

@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.

willymulyana commented 5 years ago

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

BiplovQss commented 3 years ago

same here.

iamnoorsk commented 6 months ago

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