react-native-splash-screen
react-native-splash-screen copied to clipboard
android.view.WindowLeaked ?
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",
@crazycodeboy any updates on this ? getting the same error. please help
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.
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.
+1
@baldursson Hi, were you able to resolve this issue? My app is crashing on release build like yours.
@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.
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
same here.
put android:largeHeap="true"
this in your android manifest file
i solved window leak issue using this