Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After Splash Screen remains blank screen (Android) #456

Closed
SocDario opened this issue Jun 2, 2023 · 31 comments
Closed

After Splash Screen remains blank screen (Android) #456

SocDario opened this issue Jun 2, 2023 · 31 comments
Assignees
Labels
bug Something isn't working

Comments

@SocDario
Copy link

SocDario commented Jun 2, 2023

Bug summary

Hello,
First of all great lib, good job and thanks a lot for contributing to the community.

I have followed all the steps in documentation for Android and it was working fine on Android 13 (Samsung galaxy s21), but when app was released people was reporting that on first download of the app and starting it from google play store they were expiriencing blank black screen after splash screen, but after they close app and reopen it works fine. This isn't probably bug in the lib, but just want to check if someone had same issue and is there a way to solve it?

It happens on differend android versions and phones, some of them are under android 12 version but there were also issues with 12+ devices.

Library version

v4.7.1

Environment info

System:
Linux 5.19 Ubuntu 22.04.2 LTS
x64 AMD Ryzen 5 3600 6-core
13/15.57 GB
Shell: 5.1.16

Binaries:
 Node: 18.14.2
 npm: 9.5.0

npmPac:
 React: 18.1.0
 React-native: 0.70.1

minSdkVersion: 23
compileSdkVersion = 33
targetSdkVersion = 33
kotlin_version = 1.6.21

Steps to reproduce

Blank screen after splash screen:

  1. Download App from play store
  2. Open it from play store

Working example:

  1. Close app opened from google play store
  2. Reopen it clicking on app icon from dashboard

Reproducible sample code

If needed I can provide example of lib implementation, but I followed steps from docs.
@SocDario SocDario added the bug Something isn't working label Jun 2, 2023
@zoontek
Copy link
Owner

zoontek commented Jun 2, 2023

Hello!

I never heard of that, could you provide a repository with the setup on Android? (copy / paste how you setted it up in your project).

Are you sure this isn't related to the Android bug? (as the app is started from an intent: the play store)

⚠️ On Android >= 12, the splash screen will not appear if you start your app from the terminal / Android Studio. To see it, kill your app and restart it in normal conditions (tap on your app icon in the app launcher).

(This is similar to #440)

@SocDario
Copy link
Author

SocDario commented Jun 2, 2023

Yeah I was thinking the same, app was built and tested mainly on Android 13 real device, and on few android emulators from android 10 to 13.
I will try to provide repo with android folder as soon as I can, thanks for quick response!

@zoontek
Copy link
Owner

zoontek commented Jun 2, 2023

I'm currently working on a new version without AndroidX core splashscreen package and it kind of fixes this issue

@SocDario
Copy link
Author

SocDario commented Jun 2, 2023

Great to hear that! I will close this issue until new version is available then, do you know maybe at least month of the release?

@zoontek
Copy link
Owner

zoontek commented Jun 2, 2023

Probably before the end of June 🙂

@nhutph
Copy link

nhutph commented Jul 4, 2023

any update for issue bro ?

@zoontek
Copy link
Owner

zoontek commented Jul 4, 2023

@nhutph I had other plans, visibly.

@jacobjones123
Copy link

Hello 👋 Any update on removing AndroidX?

@zoontek
Copy link
Owner

zoontek commented Aug 1, 2023

@jacobjones123 I've got it fully working, as I work during the week I will probably be able to publish the first beta this weekend 🙂

@jacobjones123
Copy link

awesome 😄 Thanks for the update @zoontek

@anuj1357
Copy link

anuj1357 commented Aug 7, 2023

@zoontek Will this also fix the logo not appearing on the Splash screen when launching the App for the first time? this happens on release builds.

@nhutph
Copy link

nhutph commented Aug 7, 2023

every things on beta oke man ?

@anuj1357
Copy link

anuj1357 commented Aug 7, 2023

every things on beta oke man ?

I don't think there is any beta release yet.

@zoontek
Copy link
Owner

zoontek commented Aug 7, 2023

@nhutph @anuj1357 Yes, yes. I worked on it all weekend (as the release doesn't include only this), please don't add unnecessary pressure. I just need to update the documentation and the migration guide and will do the release.

@zoontek
Copy link
Owner

zoontek commented Aug 8, 2023

Hi all 👋
The first beta of v5 is here: #475

@phuongnguyenzoi
Copy link

@zoontek I just tried your @next version, but it still showing black screen when I first install app.

Any idea on this one?

@zoontek
Copy link
Owner

zoontek commented Aug 14, 2023

@phuongnguyenzoi Did you correctly followed the migration guide / clean the project (using react-native-clean-project, for example) / rebuild the android app?

@zoontek
Copy link
Owner

zoontek commented Aug 21, 2023

@zoontek zoontek closed this as completed Aug 21, 2023
@dppo
Copy link

dppo commented Aug 23, 2023

The latest version 5.0.0 still has this issue, which crashes when the app is first installed and opened.

My replication devices are Samsung S22 and Android 13

The error log is as follows

android.view.WindowLeaked: Activity com.yunlumobile.MainActivity has leaked window DecorView@c169646[MainActivity] that was originally added here at android.view.ViewRootImpl.<init>(ViewRootImpl.java:1322) at android.view.ViewRootImpl.<init>(ViewRootImpl.java:1297) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:530) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148) at android.app.Dialog.show(Dialog.java:521) at com.zoontek.rnbootsplash.RNBootSplashModuleImpl$4.run(RNBootSplashModuleImpl.java:123) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8757) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

FATAL EXCEPTION: main Process: com.yunlumobile, PID: 31587 java.lang.IllegalArgumentException: View=DecorView@c169646[MainActivity] not attached to window manager at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:733) at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:619) at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:206) at android.app.Dialog.dismissDialog(Dialog.java:809) at android.app.Dialog.dismiss(Dialog.java:791) at com.zoontek.rnbootsplash.RNBootSplashModuleImpl$5$2.onShow(RNBootSplashModuleImpl.java:167) at android.app.Dialog$ListenersHandler.handleMessage(Dialog.java:1916) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8757) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

The second error is the cause of the crash

The screenshot is as follows
WX20230823-141357@2x
WX20230823-141409@2x

@dppo
Copy link

dppo commented Aug 23, 2023

Replenish
On my Samsung S22 device, when it is installed and opened for the first time, BootSplash will be automatically closed, and there is no need to call BootSplash.hide
The reason for the crash is that BootSplash.hide is called after BootSplash is automatically closed

@zoontek
Copy link
Owner

zoontek commented Aug 23, 2023

@dppo Can you provide a reproduction repository? Are you using fade: true?

@dppo
Copy link

dppo commented Aug 23, 2023

@dppo Can you provide a reproduction repository? Are you using fade: true?

I used a new project to test, although there is no crash phenomenon, but there is still an abnormal situation, the specific situation is as follows.

  1. Use react-native 0.72.4
  2. newArchEnabled=true
  3. Use react-navigation and react-native-bootsplash

In this case, install and start normally for the first time

  1. Add react-native-bars
  2. Modify the styles file

When installing and starting for the first time, there is an exception displayed, and the exception is as follows

1_1692803895.mp4

Code repository:Demo

@zoontek
Copy link
Owner

zoontek commented Aug 23, 2023

@dppo I tried to reproduce it by cloning your repository, but no issue at all with my Pixel 4a / Android emulators. My guess is that it might be a Samsung only issue (and I don't have a physical Samsung phone / Samsung don't release ROMs 😕)

You probably have an issue in your logcat when this occur. Could you publish it? Also, which Android version run on your Samsung S22?

Does this occur when you remove some libs? (ex: without bars, without navigation, etc)

@dppo
Copy link

dppo commented Aug 24, 2023

@dppo I tried to reproduce it by cloning your repository, but no issue at all with my Pixel 4a / Android emulators. My guess is that it might be a Samsung only issue (and I don't have a physical Samsung phone / Samsung don't release ROMs 😕)

You probably have an issue in your logcat when this occur. Could you publish it? Also, which Android version run on your Samsung S22?

Does this occur when you remove some libs? (ex: without bars, without navigation, etc)

  1. The Android version is 13, and another device in my hand is normal, so it should be a problem unique to Samsung phones
  2. There is a screenshot attached to the answer of the crash log
  3. The test code didn't crash, it just displayed an exception, so there are no related logs
  4. React-native-bars is not installed. It is normal to test the first installation and open, so guess that there should be a conflict between react-native-bootsplash and react-native-bars

@dppo
Copy link

dppo commented Aug 24, 2023

I noticed that you just released version 5.0.1. After updating my project, I still have this problem. The following is my Android studio log. I don’t know if it will help you to fix the problem.

log

@anuj1357
Copy link

@dppo can you confirm if after updating to 5.0.2 your problem is solved? I tried replicating it on a Samsung S22 Android 12, and it seems working for me.

@w3company-leo
Copy link

any updates? i have this issue after upgrade bootsplash version

@anuj2285
Copy link

anuj2285 commented Apr 1, 2024

const hideSplash = () => {
setTimeout(() => BootSplash.hide(), 2000);
};

<NavigationContainer onReady={hideSplash}>
      
     </NavigationContainer>

@c-info
Copy link

c-info commented May 20, 2024

Having the same issue even on emulators

show black window and splash hide automatically immediately after 1 or 2 seconds.
i have update to latest version

@DakshAg62
Copy link

I am facing an issue that, When the splash screen opens the logo appears in a circle then after that it appears normally.
Here is my styles.xml file

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
    <!-- <item name="android:forceDarkAllowed">false</item>
    <item name="android:windowBackground">@drawable/splash</item>
    <item name="android:navigationBarColor">@android:color/black</item> -->
    <!-- <item name="android:editTextBackground">@drawable/edit_text</item> -->
    <!-- Customize your theme here. -->
</style>

<style name="BootTheme" parent="Theme.BootSplash">
    <item name="bootSplashBackground">@color/black</item>
    <item name="bootSplashLogo">@drawable/splash</item>
    <item name="postBootSplashTheme">@style/AppTheme</item>
</style>

<style name="TransparentNavBar" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:navigationBarColor">@android:color/black</item>
    <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    <item name ="android:statusBarColor">@android:color/black</item>
    <!-- Customize your theme here. -->
</style>

@zoontek
Copy link
Owner

zoontek commented Jul 18, 2024

@DakshAg62 Read the warnings in your console when generating the assets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests