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

Appicon cannot be changed #4340

Closed
nssidhu opened this issue Jan 27, 2022 · 10 comments
Closed

Appicon cannot be changed #4340

nssidhu opened this issue Jan 27, 2022 · 10 comments
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer p/2 Work that is important, but is currently not scheduled for release platform/android 🤖 platform/iOS 🍎 platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@nssidhu
Copy link

nssidhu commented Jan 27, 2022

Description

I am following this article to change the appicon.
https://docs.microsoft.com/en-us/dotnet/maui/user-interface/images/app-icons?tabs=android
but it does not work.

I am using V2022 Version 17.1.0 Preview 4.0

Here is the link to screen recording for the project
Screen Recording of the problem

The repo is located at
Online Repo

Steps to Reproduce

1.Create a File > New .NET MAUI App
2. copy my .png file that i want to use as appicon to the Resource\Images folder.
3. update project file to reference this new .png file

run the project in android simulator/emulator and it still shows the default icon for the installed app on the emulator.

Version with bug

Unknown/Other (please specify)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows

Affected platform versions

iOS 15 and Android 11

Did you find any workaround?

No

Relevant log output

No response

@nssidhu nssidhu added the t/bug Something isn't working label Jan 27, 2022
@nssidhu nssidhu changed the title Appicon cnnoet be cganged Appicon cannot be changed Jan 27, 2022
@jsuarezruiz jsuarezruiz added the area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer label Jan 27, 2022
@nssidhu
Copy link
Author

nssidhu commented Feb 14, 2022

any updates on this ?

@blackforest-tom
Copy link

blackforest-tom commented Feb 16, 2022

We're also unable to use any app icon at all, tested on 2 Android devices (and Emulator) with 2 different machines and installations of VS17.1-17.2 Preview. We used various SVG files for our tests.
Not even the default .NET icon from a fresh .NET MAUI Blazor project template shows up - It's always the default Android icon.

@cetindogu
Copy link

any updates on this ?

@nssidhu
Copy link
Author

nssidhu commented Feb 25, 2022

Is this thread dead without resolution?

@blackforest-tom
Copy link

We found a possible cause and a workaround:
The problem seems to be that not all necessary PNG files are generated from the SVG.
Placing the Android app icons as PNGs into Android resources (as you would in Android Studio) and linking them directly from the manifest works for now.

@cetindogu
Copy link

@blackforest-tom how to solve issue feom visual studio 2022 ?
Any solution?
Where iş android resources directory in MAUI app?

@blackforest-tom
Copy link

@cetindogu
Create a "Resources" directory in your Platforms/Android folder, that will be merged to your platform-independent resources for an Android build. You can create the App Icon assets in Android Studio.

@kristinx0211 kristinx0211 added the s/verified Verified / Reproducible Issue ready for Engineering Triage label Mar 2, 2022
@kristinx0211
Copy link

verified repro on Android 11. repro sample:
#4340.zip

@mattleibow mattleibow modified the milestones: 6.0.300-rc.1, 6.0.300-rc.2 Mar 22, 2022
@Redth Redth modified the milestones: 6.0.300-rc.2, 6.0.300-rc.3 Apr 20, 2022
@Redth Redth modified the milestones: 6.0.300-rc.3, 6.0.300 Apr 27, 2022
@davidortinau davidortinau added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Apr 28, 2022
@nk54
Copy link

nk54 commented May 2, 2022

I have a similar problem but not the same :

if I move the appicon.svg from /Resources to /Resources/Images
It doesn't compile : I got an arror on mipmap/appicon not found.

IMHO, the folder shouldn't matter as it's a MauiIcon and it should use my path to generate things.

@Redth Redth added p/2 Work that is important, but is currently not scheduled for release and removed p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint labels May 3, 2022
@samhouts samhouts modified the milestones: 6.0.300, 6.0.300-servicing May 7, 2022
@mattleibow
Copy link
Member

I think this is a duplicate of #5652 and I think half the time when files are moved in VS the IDE decides it does not want to track the files and adds an explicit remove for everything.

You can see things like this in the repo csproj:

	<ItemGroup>
	  <MauiImage Remove="Resources\Images\new256icon.png" />
	</ItemGroup>

Also, if you look at the android manifest you can see that it explicitly sets the icon to be android:icon="@mipmap/appicon": https://github.com/nssidhu/AppIconAndSplashScreenSample/blob/master/AppIconAndSplashScreenSample/Platforms/Android/AndroidManifest.xml#L4

As of GA, the MauiIcon was just to generate the icons in the correct format and then the correct icon would be selected by the developer in the manifest. This was because you can actually have multiple icons in an all and you can change them at runtime.

However, I do believe not setting the icon to at least the first one (and most likely the only one) is a much better experience. If you want a specific one, you can totally go edit the manifest with the correct one and then add the rest as the activity alias.

Improvements are happening here: #7968

Closing this as a result of the duplicate and the issue will be tracked there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer p/2 Work that is important, but is currently not scheduled for release platform/android 🤖 platform/iOS 🍎 platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants