Adobe-Runtime-Support icon indicating copy to clipboard operation
Adobe-Runtime-Support copied to clipboard

The splash screen of the developer's own logo does not work properly on ANDROID 12 and above

Open mehmury opened this issue 1 year ago • 12 comments

Changes have been made for the special splash screens we use in applications for Android 12 and above.

I realized this situation when I bought a new mobile device. When I try my applications on my new device, the application logo of each application appears instead of the splash image that I added to my applications before.

It has been reported that this can be adjusted in a new AIR version or with an ANE to solve this situation that occurs for Android 12 and above. ()#1503 Will an API for this be added in a new Air sdk version?

I could not find any published ANE on this subject.

mehmury avatar Feb 05 '24 13:02 mehmury

Hi, Potentially a duplicate of https://github.com/airsdk/Adobe-Runtime-Support/issues/1503

I listed a way you can customise the splash screen without requiring an ANE or AIR update, just through some custom resources.

Let me know if that helps.

marchbold avatar Feb 06 '24 01:02 marchbold

@marchbold Thank you. Yes, I read and used the title you shared. The problem is that after applying these steps, the application logo of the application appears instead of my own png logo that I prepared for the splash screen. This is valid for Android 12 and later. In previous android versions, my own developer logo appears.

mehmury avatar Feb 06 '24 11:02 mehmury

Can you elaborate on what you did? The example I used displayed the app icon so that would be expected if you copied it.

You'll need to add your new image as a resource and then reference it in the splash_screen_animateable_icon.xml

<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:oneshot="true">
    <item android:drawable="@mipmap/icon" android:duration="600" />
</animation-list>

The item here references the app icon. Change that drawable to be your app logo resource, whatever name you have given it. Have a look at the Android asset studio if you want to make a resource outside of android studio. https://romannurik.github.io/AndroidAssetStudio/

marchbold avatar Feb 07 '24 01:02 marchbold

Thank you for your response. For previous Android versions, I was using a method similar to the one mentioned in the title #1503. Now I completely deleted the old styles files and applied the process you suggested alone.

first <resdir>res</resdir> in my manifest xml file I added the feature

Then I created a file named values-v33 under the res folder and set the target android version in the manifest xml to 33.

I created the styles.xml file in the values-v33 folder and took the example you gave exactly.

I created the same splash_screen_animateable_icon.xml file in the drawable folder and set its content as below.

<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:oneshot="true">
    <item android:drawable="@mipmap/splash_image" android:duration="600" />
</animation-list>


After this process, while compiling my application with Adobe Animate, I constantly get the error that I screenshotted. Ekran görüntüsü 2024-02-07 145707

Air SDK version I use: 50.2.4.3 The device I tested is Samsung Galaxy A54 android version 14. operating system PC: windows 11 pro

mehmury avatar Feb 07 '24 12:02 mehmury

That error indicates it cannot find a resource you are specifying. Could be something wrong with how you have included or written the resources.

Here's an example project and I've changed it to use a custom resource instead of the app icon:

https://github.com/marchbold/air-splashscreen-example

marchbold avatar Feb 08 '24 02:02 marchbold

Thank you very much for your informative example. I applied it according to the example and managed to use my own logo as a slash screen. I updated 9 of my applications in the Google Play store with this logo.

However, it was not possible to use two similar methods in parallel, which I used for the same purpose for this splash screen image before, so my applications show a black screen instead of a splash screen in versions before Android 12. I guess there is no solution for previous versions.

mehmury avatar Feb 09 '24 14:02 mehmury

What method were you using previously?

As long as you used the name values-v31 for the folder it should only apply this method to Android versions 31+

marchbold avatar Feb 12 '24 01:02 marchbold

I used a similar method before.

Create the file named splash_background.xml in the drawable folder and add its contents.

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:drawable="@color/splash_background_color" />
     <item>
         <bitmap
             android:gravity="center"
             android:src="@drawable/splash_image" />
     </item>
</layer-list>

I prepare it this way. I also add the splash_image.png file to the drawable folder.

Then just add styles.xml and color.xml in the folder named values. I am creating the files.

for styles.xml

<resources>
     <style name="Theme.NoShadow" parent="android:style/Theme.NoTitleBar">
         <item name="android:windowBackground">@drawable/splash_background</item>
     </style>
</resources>

for color.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
     <color name="splash_background_color">#CDA8DB</color>
</resources>

We create content.

I think styles.xml files create a conflict when we use them together with the old version you gave.

mehmury avatar Feb 12 '24 08:02 mehmury

So you should be able to do this alongside the method I have shown, just place your old styles.xml in the values folder. Then the values-v31 should override it for android 31 +

Let me know if that doesn't work and I'll investigate.

marchbold avatar Feb 13 '24 01:02 marchbold

Thank you for keeping the topic alive. Yes, exactly, when I place the old styles file in the values folder and the new one for Android 31 and later in values-v31, it works in old versions, that is, before Android 31. However, for Android 31+, the application's logo appears instead of my own developer logo. I think it is necessary to define the paths of the files in the SDK according to the new version. or something similar.

mehmury avatar Feb 13 '24 09:02 mehmury

Hmmm something sounds off there, in values-v31/styles.xml it should have a different style for the Theme.NoShadow which contains a different drawable to display? Are you correctly specifying the logo you want to display in there?

In the example above it uses @drawable/splash_screen_animateable_icon which contains a yellow icon: @drawable/ic_logo_yellow

marchbold avatar Feb 14 '24 01:02 marchbold

Yes, I tried the path in the splash_screen_animateable_icon file linked to the styles I used for values-v31 with a different png from the old styles file. The result is still negative.

The application logo still appears for Android 31+. There is one thing I noticed, when I try using only the new styles file in values-v31, I also get an error when compiling it without re-copying the new styles file in parallel into the empty values folder.

Also, when using the only new system, it seems that there is a mask that shades and covers the area around the logo. I overcame the problem by making the logo small enough.

mehmury avatar Feb 14 '24 07:02 mehmury