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

Branding image not working on android 12 #413

Closed
mirland opened this issue Sep 2, 2022 · 3 comments · Fixed by #414
Closed

Branding image not working on android 12 #413

mirland opened this issue Sep 2, 2022 · 3 comments · Fixed by #414

Comments

@mirland
Copy link
Contributor

mirland commented Sep 2, 2022

Error:

/values-v31/styles.xml:4:5-11:13: AAPT: error: resource drawable/branding (aka package:drawable/branding) not found.

Library version: 2.2.8

Setup:

flutter_native_splash:
  color: '#ee1a64'
  image: 'assets/splash_logo.png'
  android_12:
    image: 'assets/splash_logo_android_12.png'
    branding: 'assets/splash_branding.png'

/values-v31/styles.xml content:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
    <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
        <item name="android:forceDarkAllowed">false</item>
        <item name="android:windowFullscreen">false</item>
        <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
        <item name="android:windowSplashScreenBackground">#ee1a64</item>
        <item name="android:windowSplashScreenBrandingImage">@drawable/branding</item>
        <item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
    </style>
    <!-- Theme applied to the Android Window as soon as the process has started.
         This theme determines the color of the Android Window while your
         Flutter UI initializes, as well as behind your Flutter UI while its
         running.
         
         This Theme is only used starting with V2 of Flutter's Android embedding. -->
    <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
        <item name="android:windowBackground">?android:colorBackground</item>
    </style>
</resources>

Drawable folder content:
image

Command result:

[Android] Creating splash images
[Android] Creating android12splash images
[Android] Updating launch background(s) with splash image path...
[Android]  - android/app/src/main/res/drawable/launch_background.xml
[Android]  - android/app/src/main/res/drawable-v21/launch_background.xml
[Android] Updating styles...
[Android]  - android/app/src/main/res/values-v31/styles.xml
[Android]  - android/app/src/main/res/values/styles.xml
[iOS] Creating  images
[iOS] Updating ios/Runner/Info.plist for status bar hidden/visible
Web folder not found, skipping web splash update...
╔════════════════════════════════════════════════════════════════════════════╗
║                                 WHAT IS NEW:                               ║
╠════════════════════════════════════════════════════════════════════════════╣
║ You can now keep the splash screen up while your app initializes!          ║
║ No need for a secondary splash screen anymore. Just use the remove()       ║
║ method to remove the splash screen after your initialization is complete.  ║
║ Check the docs for more info.                                              ║
╚════════════════════════════════════════════════════════════════════════════╝

✅ Native splash complete.
Now go finish building something awesome! 💪 You rock! 🤘🤩
Like the package? Please give it a 👍 here: https://pub.dev/packages/flutter_native_splash

@Macacoazul01
Copy link

@mirland this pr helps with #398?

@aintend-com
Copy link

The same issue Here, and #398 didnt help?

@mirland
Copy link
Contributor Author

mirland commented Sep 6, 2022

I think they are different issues, because this issue is related to android 12 branding image. However, #398 has not branding image issues

jonbhanson pushed a commit that referenced this issue Sep 7, 2022
* Fix android 12 issues

* Code improvements

* Minor code improvements

* Remove extra line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants