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

android.os.BinderProxy@424e5cf8 is not valid; is your activity running?

Open zengyimou opened this issue 7 years ago • 10 comments

Caused by android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@424e5cf8 is not valid; is your activity running? at android.view.ViewRootImpl.setView(ViewRootImpl.java:578) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:269) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69) at android.app.Dialog.show(Dialog.java:323) at com.cboy.rn.splashscreen.SplashScreen$1.run(SplashScreen.java:34) at android.app.Activity.runOnUiThread(Activity.java:4766) at com.cboy.rn.splashscreen.SplashScreen.show(SplashScreen.java:24) at com.cboy.rn.splashscreen.SplashScreen.show(SplashScreen.java:44) at com.zun1.flyapp.MainActivity.onCreate(MainActivity.java:93) at android.app.Activity.performCreate(Activity.java:5285) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2259) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2345) at android.app.ActivityThread.access$1100(ActivityThread.java:139) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5314) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680) at dalvik.system.NativeStart.main(NativeStart.java)

this carsh only happen on android 4.0 , please help me .

zengyimou avatar Apr 09 '18 03:04 zengyimou

someone can help?

zengyimou avatar Apr 13 '18 06:04 zengyimou

I am also facing the same issue. Couldn't figure out the solution yet.

techyrajeev avatar Apr 23 '18 08:04 techyrajeev

I am also the same issue, I comment out // SplashScreen.show(this); this code . Android Studio 3.1.2 React Naitve 0.55.3 Splash Screen Version: 3.0.6

Mad-hu avatar Apr 26 '18 13:04 Mad-hu

Seems to be a Contect Problem, your context not exist when you call it, look here for more informations:

https://stackoverflow.com/questions/38298887/logout-dialog-error-token-android-os-binderproxy4276c0e8-is-not-valid-is-your

oOGenosOo avatar Jun 12 '18 09:06 oOGenosOo

but , it only happens on android 4. Why other version didn't happen?

zengyimou avatar Jun 14 '18 02:06 zengyimou

Maybe is not a problem of android 4 but a problem of device speed, an android 4 device is slower (faster if is an emulator) that a newer one, and some asyncronous task end later than you expect, working on a non existent context (that you've previously dispose).... thy to change the way you get your context.

oOGenosOo avatar Jun 14 '18 08:06 oOGenosOo

ok thanks your help

zengyimou avatar Jun 14 '18 08:06 zengyimou

I also get the same error. But the problem is that the same project is working in Lollipop and not working in Nougat version. and I am getting the below error.

One more point I want to share with you all. After crashing the app in Nougat with below error and when I open the app again it works fine i.e the app is not crashing. I don't know where is the problem.

Can some please help me with this issue.

android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@9a1a5d9 is not valid; is your activity running? at android.view.ViewRootImpl.setView(ViewRootImpl.java:808) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:351) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93) at android.widget.Toast$TN.handleShow(Toast.java:465) at android.widget.Toast$TN$2.handleMessage(Toast.java:347) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:203) at android.app.ActivityThread.main(ActivityThread.java:6339) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1084) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:945)

globalsalt avatar Mar 21 '19 18:03 globalsalt

@globalsalt Were you able to find a fix? I am facing the same issue.

Prernabudh avatar May 17 '21 11:05 Prernabudh

I'm using react-native-splash-screen 3.3.0 and still facing this issue. Any update on this?

minhkwan avatar Jan 22 '25 07:01 minhkwan