dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.05k stars 1.73k forks source link

Changing app icon of .NET MAUI app, then invoking MediaPicker crashes the app #8901

Closed vsfeedback closed 2 years ago

vsfeedback commented 2 years ago

This issue has been moved from a ticket on Developer Community.


[severity:I’m unable to use this version]
Replacing the appicon of a .NET MAUI app, then invoking MediaPicker crashes the app.

I do follow the documentation and clean the project/solution after updating the app icon AND remove the app already installed on device before re-compiling and re-installing it.

I created a public repo and the steps to reproduce the crash in the README file. Here’s the link to my repo:
https://github.com/imsam67/maui-appicon-crash

P.S. I’m using the latest version of Visual Studio 2022 Preview Version 17.3.0 Preview 2.0 on Windows 11 with latest updates.

And here's the SO question I posted: https://stackoverflow.com/questions/72903979/net-maui-app-mediapicker-is-crashing-with-android-content-res-resourcesnotfo


Original Comments

Feedback Bot on 7/8/2022, 02:57 AM:

(private comment, text removed)


Original Solutions

Sam Uresin solved on 7/8/2022, 02:06 PM, 0 votes:

This is definitely an issue caused by the AppIcon – or lack thereof in this case. Looks like .NET MAUI is NOT automatically generating the correct app icons form the svg file placed in Resources\AppIcon folder.

I manually created an icon and placed it under Platforms\Android\Resources\mipmap folder and then linked it in AndroidManifest.xml. It’s important to note that I had to place two files in the Platforms\Android\Resources\mipmap folder i.e. app_icon.png and app_icon_round.png. These two files are then referenced in AndroidManifest.xml.

Now everything is working as it should.

Bottom line, .NET MAUI doesn’t seem to automatically generate the necessary app icon and it looks like the icon is used when we open the photo gallery. Not having the app icon where the app is expecting to find it is what’s crashing the app.

jfversluis commented 2 years ago

If the author happens to see this... Would you be able to test with the last release from a couple of days ago? I know we did some improvements on the app icon area.

Let us know what you find with that, thanks!

ghost commented 2 years ago

Hi @vsfeedback. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost commented 2 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.