zoontek / react-native-bootsplash

🚀 Show a splash screen during app startup. Hide it when you are ready.
MIT License
3.74k stars 258 forks source link

Hide logo on splash screen #639

Closed cetinahmetemre closed 1 month ago

cetinahmetemre commented 1 month ago

Before submitting a new issue

Bug summary

Hi, first of all, thanks for all the hard work on this package! 🙌

I added the code from the 'Reproducible sample code' section to the styles.xml to hide the logo in the splash screen. However, I am encountering the following crash only on the Redmi Note 13 Pro+ 5G (Android 14) device. Is this method correct for hiding the logo?

Crash log; Fatal Exception: java.lang.NullPointerException Attempt to invoke virtual method 'int android.graphics.drawable.Drawable.getSmoothCornerState()' on a null object reference android.graphics.drawable.LayerDrawable.getSmoothCornerState (LayerDrawable.java:1032) android.view.View.getDrawableRenderNode (View.java:25122) android.view.View.drawBackground (View.java:25049) android.view.View.draw (View.java:24777) com.android.internal.policy.DecorView.draw (DecorView.java:896) android.view.View.updateDisplayListIfDirty (View.java:23584) android.view.ThreadedRenderer.updateViewTreeDisplayList (ThreadedRenderer.java:736) android.view.ThreadedRenderer.updateRootDisplayList (ThreadedRenderer.java:745) android.view.ThreadedRenderer.draw (ThreadedRenderer.java:851) android.view.ViewRootImpl.draw (ViewRootImpl.java:5720) android.view.ViewRootImpl.performDraw (ViewRootImpl.java:5363) android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:4457) android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:3014) android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:10526) android.view.Choreographer$CallbackRecord.run (Choreographer.java:1671) android.view.Choreographer$CallbackRecord.run (Choreographer.java:1680) android.view.Choreographer.doCallbacks (Choreographer.java:1191) android.view.Choreographer.doFrame (Choreographer.java:1063) android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1650) android.os.Handler.handleCallback (Handler.java:958) android.os.Handler.dispatchMessage (Handler.java:99) android.os.Looper.loopOnce (Looper.java:222) android.os.Looper.loop (Looper.java:314) android.app.ActivityThread.main (ActivityThread.java:8680) java.lang.reflect.Method.invoke (Method.java) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:565) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1081)

Library version

6.1.3

Environment info

System:
  OS: macOS 14.1.2
  CPU: (8) x64 Apple M1
  Memory: 16.46 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.17.0
    path: ~/.nvm/versions/node/v18.17.0/bin/node
  Yarn:
    version: 3.6.4
    path: /usr/local/bin/yarn
  npm:
    version: 9.6.7
    path: ~/.nvm/versions/node/v18.17.0/bin/npm
  Watchman:
    version: 2021.11.15.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.0
      - iOS 17.0
      - macOS 14.0
      - tvOS 17.0
      - watchOS 10.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.3 AI-233.14808.21.2331.11842104
  Xcode:
    version: 15.0.1/15A507
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.9
    wanted: 0.73.9
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to reproduce

-

Reproducible sample code

<!-- Splash screen theme -->
<style name="BootTheme" parent="Theme.BootSplash">
    <item name="bootSplashBackground">@color/bootsplash_background</item>
    <!--  Hide splash logo -->
    <item name="bootSplashLogo">@null</item>
    <item name="postBootSplashTheme">@style/AppTheme</item>
    <item name="android:statusBarColor">@color/bootsplash_background</item>
</style>
zoontek commented 1 month ago

No, for the moment, use a transparent pixel. MIUI tries to manipulate the image and crash as it doesn't exist.