Automatically add MauiIcon to AndroidManifest.xml#8063
Automatically add MauiIcon to AndroidManifest.xml#8063mattleibow wants to merge 1 commit intonet6.0from
Conversation
|
@jonathanpeppers mentions: #8020 (comment)
However, since the functionality is very inconsistent right now and is causing major confusion, I would like to make MAUI do this, then when Android gets the feature (and iOS) then we can remove these changes. |
| <GenerateAndroidManifestXml | ||
| AppIcon="@(MauiImage->WithMetadataValue('IsAppIcon', 'true'))" | ||
| Manifest="$(IntermediateOutputPath)android\AndroidManifest.xml" | ||
| IntermediateOutputPath="$(IntermediateOutputPath)android" | ||
| GeneratedFilename="AndroidManifest.xml" /> |
There was a problem hiding this comment.
Yeah, I don't think writing directly to $(IntermediateOutputPath)android\AndroidManifest.xml is a good idea. If that file changes, it skips Fast Deployment. It will have to build, sign, and adb install the .apk. There aren't any tests that deploy apps checking targets skip & the overall time is under a threshold. We have those in the xamarin-android repo.
Could we fix this in .NET 7 instead? And introduce new MSBuild properties in the Android, iOS, etc. workloads?
There was a problem hiding this comment.
Alternatively, could you write to MAUI's own manifest and use the manifest merging feature?
There was a problem hiding this comment.
maybe we just need to document this and fix it in net7 then. @Redth @davidortinau @davidbritch
|
Closing this as the issue needs to be fixed in the SDKs: |
Description of Change
On Android (and iOS / Mac Catalyst) the app icons are not actually added to the manifests because that code was not written. For some reason I had determined that people would always use the same filename and thus the templates would be good - and somehow knowledge would arrive in the brains of devs to go change values in the platform files when editing the csproj.
This was obviously wrong and even though the docs are technically incorrect because they do not state that you have to change values in the manifest, this PR goes ahead and does the expected thing and makes sure there is an icon in the manifest.
Issues Fixed