flutter_native_splash icon indicating copy to clipboard operation
flutter_native_splash copied to clipboard

Black screen when entering an application pushed to Google Play Store

Open longnh2k1 opened this issue 1 year ago • 3 comments

I got a black screen when entering the app on Android 11, but before that the release and debug builds were normal, but when I uploaded the app to the Google Play Store, that error appeared.

Here is my configuration and I didn't do anything else:

flutter_native_splash:
  image: "assets/images/splash/LOGO_SPLASH.png"
  background_image: "assets/images/splash/BG_SPLASH_MOBILE.png"
  branding: "assets/images/splash/BRANDING.png"

  android_12:
    color: "#ffffff"
    image: "assets/images/splash/ANDROID12_LOGO_SPLASH.png"
    branding: "assets/images/splash/ANDROID12_BRANDING.png"
  web: false

https://github.com/jonbhanson/flutter_native_splash/assets/153590374/1cdfe981-af52-41be-9ec6-7b67101df5c1

Thanks for supporting me.❤️‍🔥

longnh2k1 avatar Jul 04 '24 16:07 longnh2k1

If you generate an APK and sideload it onto an Android device, bypassing the Play Store, does the splash screen display correctly?

jonbhanson avatar Jul 07 '24 15:07 jonbhanson

When I build the apk it works fine, only when I push it to Google Play it gets a black screen.

longnh2k1 avatar Jul 08 '24 15:07 longnh2k1

I'm also getting black screen on app start

flutter_native_splash:
  color: "#ffffff"
  color_dark: "#ffffff"

  android_12:
    color: "#ffffff"
    color_dark: "#ffffff"

dipak-pd avatar Jul 23 '24 09:07 dipak-pd

Hey @jonbhanson I too have just very recently started to get this same issue mainly on Android. iOS does not raise the issue.

Below is a copy of the logs when running the app on either debug or profile on a physical device

✓ Built build/app/outputs/flutter-apk/app-profile.apk (39.7MB)
E/AndroidRuntime(16259): FATAL EXCEPTION: wmshell.splashworker
E/AndroidRuntime(16259): Process: com.android.systemui, PID: 16259
E/AndroidRuntime(16259): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.draw(android.graphics.Canvas)' on a null object reference
E/AndroidRuntime(16259): 	at com.android.wm.shell.startingsurface.SplashscreenIconDrawableFactory$AdaptiveForegroundDrawable.draw(qb/86311146 a982e1cc43cc24626999ad7f15d99b1b844bce33646868d28d69453e901c655d:6)
E/AndroidRuntime(16259): 	at com.android.wm.shell.startingsurface.SplashscreenIconDrawableFactory$ImmobileIconDrawable.preDrawIcon(qb/86311146 a982e1cc43cc24626999ad7f15d99b1b844bce33646868d28d69453e901c655d:31)
E/AndroidRuntime(16259): 	at com.android.wm.shell.startingsurface.SplashscreenIconDrawableFactory$ImmobileIconDrawable$$ExternalSyntheticLambda0.run(qb/86311146 a982e1cc43cc24626999ad7f15d99b1b844bce33646868d28d69453e901c655d:23)
E/AndroidRuntime(16259): 	at android.os.Handler.handleCallback(Handler.java:958)
E/AndroidRuntime(16259): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(16259): 	at android.os.Looper.loopOnce(Looper.java:230)
E/AndroidRuntime(16259): 	at android.os.Looper.loop(Looper.java:319)
E/AndroidRuntime(16259): 	at android.os.HandlerThread.run(HandlerThread.java:67)

My pubspec file definition

flutter_native_splash:
  android: true
  ios: true
  web: false
  color: '#FFFFFF'
  image: cu_graphics/icon.png
  android_12:
    color: '#FFFFFF'

Let me know what you propose as a solution

TJMusiitwa avatar Dec 09 '24 15:12 TJMusiitwa

@jonbhanson Please ignore turns out not an issue with this package but with the launcher icons package where there is a PR awaiting to address the issue causing this.

TJMusiitwa avatar Dec 09 '24 16:12 TJMusiitwa

@longnh2k1 is this also the cause of your trouble?

jonbhanson avatar Dec 09 '24 22:12 jonbhanson

Had the same issue when i was using

flutter_launcher_icons: ^0.14.2
flutter_native_splash: ^2.4.4

To fix the issue under flutter_launcher_icons.yaml you need to add the following

adaptive_icon_background: "#FFFFFF" //this is a color not an image
adaptive_icon_foreground: "assets/logo.png"
adaptive_icon_monochrome: "assets/logo.png"

collohdicey avatar Jan 15 '25 18:01 collohdicey

Closing this as it was caused by flutter_launcher_icons.

jonbhanson avatar Feb 23 '25 17:02 jonbhanson