Closed Syed-RI closed 14 hours ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
@Syed-RI I have an app in production compiled with 8.0.60 SR6 that is tested on physical devices with all supported Android versions including Android 7 and the app icon is showing correctly (despite its look not being the same as in latest Android versions). Image below is from a Samsung A3 2016 running Android 7 (last Android version supported on that device). So the issue you describe seems either device-specific or emulator related.
It happens on physical device as well. I think it is probably related to the screen resolution mine was 1280 x 720.
It happens on physical device as well. I think it is probably related to the screen resolution mine was 1280 x 720.
Galaxy A3 (2016) is also 720 x 1280 so it does not seem to be the resolution.
And here's your icon on my Galaxy A3 (2016) running Android 7:
And here's your icon on my Galaxy A3 (2016) running Android 7:
Plot thickens
Plot thickens
There is a caveat though: Samsung Android 7 devices use an icon container by default (visible in my image) which may hide the true issue you are facing on your device/emulator. So indeed worth checking further in case Android 7 is really important to you; but according to this chart the share of Nougat users is now less than 1.5% worldwide.
This issue has been verified using Visual Studio 17.11.0 Preview 2.1 (8.0.60 & 8.0.40 & 8.0.10). Can be reproduced on Android(7.1 &1280 x 720)platform.
There is a caveat though: Samsung Android 7 devices use an icon container by default (visible in my image) which may hide the true issue you are facing on your device/emulator. So indeed worth checking further in case Android 7 is really important to you; but according to this chart the share of Nougat users is now less than 1.5% worldwide.
This is for an enterprise app and we are committed to provide support for Android 7 and up. Besides, MAUI SDK itself supports Android 7 and up therefore I think this should be looked at. Probably needs a Resizetizer tweak? cc @mattleibow @Redth
I'll have a look. This is very weird as we have not really changed anything and there should be a drawable fallback.
OK, I managed to repro it... Not sure the issue yet as the images are there and the image works for Android 6.0.
I typically test Android 6, 9, 10, 13, 14 since they are on borders of major OS changes. They all work on those I believe, so Android 7 is giving us gifts of joy it seems.
I had a look and I see why this is happening:
This means that specifically for Android 7, the round icons are PNG files but for Android 8 they are adaptive icons.
So, the first workaround is to just drop round icons altogether. This means you will lose round icons on all Android versions, but just involves deleting the android:roundIcon="@mipmap/appicon_round"
from your Platforms/Android/AndroidManifest.xml
If you still want round icons for new Android versions and maybe less concerned with the Android 7 app icon adherence to the "round" design, you could copy the generated icons from obj/Debug/net8.0-android/resizetizer/r/mipmap-*/appicon.png
and add them to Platforms/Android/Resources/mipmap-*/appicon_round.png
. Then in your csproj, you can add them as Android-specific resources: <AndroidResource Include="Platforms\Android\Resources\mipmap-*\*" />
This will just be a copy of the "legacy" icons and pretend they are round. But, if that is not viable, then you can potentially generate the round ones using a graphics program and place them in the same location. As long as you name it all the same as the other icons, they will just work together.
As soon as I have a fix for generating legacy round icons, I will link to it.
I had a look and I see why this is happening:
- Android 6 only supported "square" icons
- Android 7 added round icons - https://developer.android.com/about/versions/nougat/android-7.1#circular-icons
- Android 8 switched to adaptive icons - https://developer.android.com/studio/write/create-app-icons#launcher
This means that specifically for Android 7, the round icons are PNG files but for Android 8 they are adaptive icons.
So, the first workaround is to just drop round icons altogether. This means you will lose round icons on all Android versions, but just involves deleting the
android:roundIcon="@mipmap/appicon_round"
from yourPlatforms/Android/AndroidManifest.xml
If you still want round icons for new Android versions and maybe less concerned with the Android 7 app icon adherence to the "round" design, you could copy the generated icons from
obj/Debug/net8.0-android/resizetizer/r/mipmap-*/appicon.png
and add them toPlatforms/Android/Resources/mipmap-*/appicon_round.png
. Then in your csproj, you can add them as Android-specific resources:<AndroidResource Include="Platforms\Android\Resources\mipmap-*\*" />
This will just be a copy of the "legacy" icons and pretend they are round. But, if that is not viable, then you can potentially generate the round ones using a graphics program and place them in the same location. As long as you name it all the same as the other icons, they will just work together.
As soon as I have a fix for generating legacy round icons, I will link to it.
Awesome Matt!
We can live without the round icons so I'll look into it tomorrow. But IIRC, I have tried copying and pasting from resizetizer output and that broke the build as on next build resizetizer complained about same assets (i.e. appicon.png) being present in the dir.
resizetizer complained about same assets
Yeah, make sure to copy the appicon
and rename to appicon_round
. You will just need those variants as all the others are still generated.
This PR has the fixes to generate round icons for Android 7 https://github.com/dotnet/maui/pull/23276
/similarissues
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Description
App icon in the launcher and task switcher is not displaying for Android 7. However, Android 8 and up works
Steps to Reproduce
Create a new maui app and deploy to an emulator running Android 7 (7.1.1) with a screen resolution of 1280 x 720. Or build and deploy the repro attached to same emulator.
Link to public reproduction project repository
https://github.com/Syed-RI/DeployTest
Version with bug
8.0.60 SR6
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 7.1.1
Did you find any workaround?
Works on Android 8 and up
Relevant log output
No response