Description
On first rebuild, resizetizer sometimes runs too late on Android in Visual Studio 17.10.0 Preview 2 / .NET 9.0 Preview 2.0 if the obj directory is empty / deleted, leading to a build failure / AndroidManifest processing failure, because there are no appicons. This seems to happen when connected to also Mac and building iOS version at the same time. The build process should ensure that resizetizer has enough time to run before processing AndroidManifest, when it is also making icons for iOS and other platforms.
Steps to Reproduce
- Create an empty .NET 9.0 MAUI project in Visual Studio 17.10.0 Preview 2 (I also linked below a bigger game project I'm working for where it happens, too, but this is unnecessary to observe this bug)
- If it is an old project, make sure that obj and bin directories are empty or deleted
- Make sure that you are connected to Mac (not sure if it matters that iPad / iOS Remote Device has been selected for Debug)
- Rebuild it for Android, iOS, Mac, and Windows
- Sometimes the build fails because of failure to process AndroidManifest due to a missing icon. iOS icons seems to be generated always ok. It seems like this is happening about 1/3 of the time when there is a lot going on with the build process, but does not depend on the size of the project, since it can happen with an empty project, too.
- On second rebuild the build normally succeeds
Link to public reproduction project repository
https://github.com/hyvanmielenpelit/GnollHack
Version with bug
9.0.0-preview.1.9973
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 14
Did you find any workaround?
Rebuild second time; it probably helps that iOS icons and other stuff in obj are then already generated. But it is a bit silly that building even an empty .NET MAUI project often does not work first time when connected to Mac. When I disconnected from Mac, Android started building just fine, but then iOS is not building.
Relevant log output
Rebuild started at 14.27...
1>------ Rebuild All started: Project: Net9MauiTest, Configuration: Debug Any CPU ------
Restored C:\Users\janne\source\repos\Net9MauiTest\Net9MauiTest\Net9MauiTest.csproj (in 551 ms).
1>C:\Program Files\dotnet\sdk\9.0.100-preview.2.24157.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
1>C:\Program Files\dotnet\sdk\9.0.100-preview.2.24157.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
1>Executing SayHello Task to establish a connection to a Remote Server.
1> Properties:
1> SessionId=5b5bf3b66f7ebc1e2e2ede046de2ad61bb83cfd82ea9fa3786261aea656149a9,
1> Addresss=192.168.100.13,
1> SshPort=22,
1> TcpPort=59882,
1> User=Janne Gustafsson,
1> AppName=Net9MauiTest,
1> VisualStudioProcessId=20516,
1> ContinueOnDisconnected=False
1>C:\Program Files\dotnet\sdk\9.0.100-preview.2.24157.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
1>C:\Program Files\dotnet\sdk\9.0.100-preview.2.24157.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(314,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
1>Net9MauiTest -> C:\Users\janne\source\repos\Net9MauiTest\Net9MauiTest\bin\Debug\net9.0-maccatalyst\maccatalyst-x64\Net9MauiTest.dll
1>Net9MauiTest -> C:\Users\janne\source\repos\Net9MauiTest\Net9MauiTest\bin\Debug\net9.0-android\Net9MauiTest.dll
1>Net9MauiTest -> C:\Users\janne\source\repos\Net9MauiTest\Net9MauiTest\bin\Debug\net9.0-windows10.0.19041.0\win10-x64\Net9MauiTest.dll
1>Detected signing identity:
1> Code Signing Key: "Apple Development: Janne Gustafsson (3JF32923Y3)" (6684097D3A3B22464A8EEE0E4C270F232A34C006)
1> Provisioning Profile: "VS: WildCard Development" (071bd524-44c5-4a7b-8499-ba0ab7851d02)
1> Bundle Id: com.companyname.net9mauitest
1> App Id: CUG8RS847T.com.companyname.net9mauitest
1>C:\Users\janne\source\repos\Net9MauiTest\Net9MauiTest\Platforms\Android\AndroidManifest.xml : error APT2260: resource mipmap/appicon (aka com.companyname.net9mauitest:mipmap/appicon) not found.
1>C:\Users\janne\source\repos\Net9MauiTest\Net9MauiTest\Platforms\Android\AndroidManifest.xml : error APT2260:
1>C:\Users\janne\source\repos\Net9MauiTest\Net9MauiTest\Platforms\Android\AndroidManifest.xml : error APT2260: This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
1>C:\Users\janne\source\repos\Net9MauiTest\Net9MauiTest\Platforms\Android\AndroidManifest.xml : error APT2260: resource mipmap/appicon_round (aka com.companyname.net9mauitest:mipmap/appicon_round) not found.
1>C:\Users\janne\source\repos\Net9MauiTest\Net9MauiTest\Platforms\Android\AndroidManifest.xml : error APT2260:
1>C:\Users\janne\source\repos\Net9MauiTest\Net9MauiTest\Platforms\Android\AndroidManifest.xml : error APT2260: This error is likely caused by an issue with the AndroidManifest.xml file or an Android manifest generation attribute in a source code file.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.99.0-preview.2.189\tools\Xamarin.Android.Aapt2.targets(214,3): error APT2067: failed processing manifest.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.99.0-preview.2.189\tools\Xamarin.Android.Aapt2.targets(214,3): error APT2067:
1>Done building project "Net9MauiTest.csproj" -- FAILED.
1>Net9MauiTest -> C:\Users\janne\source\repos\Net9MauiTest\Net9MauiTest\bin\Debug\net9.0-ios\ios-arm64\Net9MauiTest.dll
1>Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
Description
On first rebuild, resizetizer sometimes runs too late on Android in Visual Studio 17.10.0 Preview 2 / .NET 9.0 Preview 2.0 if the obj directory is empty / deleted, leading to a build failure / AndroidManifest processing failure, because there are no appicons. This seems to happen when connected to also Mac and building iOS version at the same time. The build process should ensure that resizetizer has enough time to run before processing AndroidManifest, when it is also making icons for iOS and other platforms.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/hyvanmielenpelit/GnollHack
Version with bug
9.0.0-preview.1.9973
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 14
Did you find any workaround?
Rebuild second time; it probably helps that iOS icons and other stuff in obj are then already generated. But it is a bit silly that building even an empty .NET MAUI project often does not work first time when connected to Mac. When I disconnected from Mac, Android started building just fine, but then iOS is not building.
Relevant log output