Universe
Universe

Reputation: 125

Issue found: Missing app icon in splash screen

Google playstore suddenly rejects App Update due to a supposedly missing splash screen icon.

Issue found: Missing app icon in splash screen

Your app does not show a 48x48dp app icon on a black background during app startup. For more information, see Branded launch.

This never was a problem before with previous versions of the app and suddenly after the launch of wear os 4, this happens. However, when opening the app (installed via adb), a splash screen with the icon does appear, just like with any other apps.

i tried adding in a custom splash screen, according to the guidelines with the correct dimensions, but google still rejects it. The manifest.xml hasnt changed, still pointing to my theme.xml, although now tried with a custom splash screen theme field.

Upvotes: 3

Views: 1316

Answers (4)

Sean Barbeau
Sean Barbeau

Reputation: 11756

This Google Play rejection message can also apply to the sitation where you're missing a white circular background behind your splash screen icon - it must exactly match the launcher icon in appearance.

If you're using an adaptive icon on Wear, you can tell the system the background color to use for the splash screen icon using windowSplashScreenIconBackgroundColor:

https://developer.android.com/reference/android/R.attr#windowSplashScreenIconBackgroundColor

You can add this to your theme in your res/values/styles.xml file:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
  <style name="WearAppTheme" parent="@android:style/Theme.DeviceDefault">
    <item name="android:windowSplashScreenIconBackgroundColor" tools:targetApi="s">
      @color/white
    </item>
  </style>
</resources>

And make sure to point to this theme in your AndroidManifest.xml:

  <application
      android:name="com.myapp.demo"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/WearAppTheme">

Upvotes: 0

Ryan Brink
Ryan Brink

Reputation: 11

For anyone else running into this issue, I've discovered there may be a bug in Wear OS where the theme's windowSplashScreenIconBackgroundColor doesn't always get drawn. I was actually able to get my Wear OS simulator into a state where even first-party Apps (like Google Play) were launching with no circle background behind their logo.

I was able to get a background to draw consistently, even in this weird OS state, by adding it to the launch screen icon itself.

Here is our launch screen icon code, as referenced by windowSplashScreenAnimatedIcon in the Theme.App.Starting style we have:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<!-- This background seems like it shouldn't be needed, but we have discovered that sometimes 
Wear OS stops drawing the background specified in the theme (windowSplashScreenIconBackgroundColor)
so we add a background here to ensure that the icon and it's appropriate background is always visible. 
It seemed that a cold boot caused Wear OS to work properly (use the windowSplashScreenIconBackgroundColor).
 -->
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@color/splash_screen_background"/>
        </shape>
    </item>

    <item
        android:width="@dimen/launch_screen_icon_size"
        android:height="@dimen/launch_screen_icon_size"
        android:drawable="@drawable/launch_screen_icon"
        android:gravity="center" />
</layer-list>

We spent way too many review cycles trying to figure this out, so I'm hoping this saves someone else the headaches we experienced!

Upvotes: 1

Yuri Schimke
Yuri Schimke

Reputation: 13488

Instructions are here https://developer.android.com/training/wearables/apps/splash-screen

dependencies {
    implementation("androidx.core:core-splashscreen:1.1.0-alpha02")
}

Make sure you are using version 1.0.1 or higher, to get support for default Wear OS dimensions.

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        // Handle the splash screen transition.
        installSplashScreen()

        super.onCreate(savedInstanceState)
        setContent {
            WearApp("Wear OS app")
        }
    }
}

Configure a theme (see link for more details)

<manifest>
    <application android:theme="@style/Theme.App.Starting">
       <!-- or -->
       <activity android:theme="@style/Theme.App.Starting">
          <!-- ... -->
</manifest>

Upvotes: 2

dect
dect

Reputation: 563

Yes, google is being a b**** after wear os 4... my apps get reject for splash screen, scrollbar not showing, missing bezel scroll support...

Anyway, here's the solution for you (at least that's what I'm doing and it is working / I tried other ways, but none worked for me):

  1. Add your app icon file to your drawables folder;
  2. Create a splash_background.xml on drawables folder and add the code:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@android:color/black"/>
        </shape>
    </item>
    <item android:drawable="@drawable/APP_ICON_NAME_HERE"
        android:gravity="center"
        android:height="48dp"
        android:width="48dp"/>
</layer-list>
  1. Create a themes.xml file, or add to yours, in the values folder and add the code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="SplashTheme" parent="@android:style/Theme.DeviceDefault">
        <item name="android:windowBackground">@drawable/splash_background</item>
    </style>

    <style name="MainTheme" parent="@android:style/Theme.DeviceDefault"></style>
</resources>
  1. In your manifest add the following code to your main activity tag:
android:theme="@style/SplashTheme"
  1. On the onCreate of your main activity class, before the "setContentView(...)" you change the theme back to normal, adding the code:
setTheme(R.style.MainTheme);

Upvotes: 10

Related Questions