11

I've been developing a .NET MAUI app on my Windows 11 machine which works perfectly.

When I try to compile and run it on a Mac, running the latest version of Visual Studio for Mac - 17.3 Preview build 1038, I get two errors -- see below:

Source file 'obj/Debug/net6.0-android/resizetizer/sp/maui_splash_image.xml' could not be found (XA2001)
Source file 'obj/Debug/net6.0-android/resizetizer/sp/maui_colors.xml' could not be found (XA2001)

enter image description here

Any idea what's causing this and how to fix it?

P.S. I started this project from scratch on my PC so it's not a conversion from Xamarin.

Sam
  • 26,817
  • 58
  • 206
  • 383
  • 1
    I suppose an obvious test is to start over on the Mac, create a similar project, see if that works. If not, then look again at instructions for setting up Maui *Android* development on Mac. If it does work, then compare the files in the project to find the difference. – ToolmakerSteve Jun 25 '22 at 19:35
  • 1
    I already tried starting a new .NET MAUI app which compiles and launches on simulator fine but then again, it doesn't have all the code and the additional packages my app has. My google search didn't return anything on this somewhat strange error. – Sam Jun 25 '22 at 19:41
  • 1
    "then compare the files in the project to find the difference" – Jason Jun 25 '22 at 20:20

3 Answers3

16

Cleaning and building the Solution (not the single project) fixed it for me.

UPDATE: Rebuild also works. Sometimes you'll have to do this twice it to work.

enter image description here

Monasha
  • 882
  • 1
  • 12
  • 17
1

I had this problem when creating the APK for my MAUI app. Cleaning and rebuilding as the other answers suggested did not work.

I solved it by creating a new MAUI project and going through the deployment process to generate the files; and then replace my actual project files (my problem was in the resizetizer folder) with the generated ones. This got rid of the error.

AT123
  • 11
  • 3
0

Cleaning, and then building the solution then resulted in error code = "AMM000" on File "AndroidManifest.xml". I found virtually nothing on that code. Ultimately, I spent a few hours creating a new project and moved my code over to the new project, line-by-line.
Not a great bug. I believe all that I did was change my icon file, but I guess I'll rename my actual icon to the sample "bot" icon that comes in the sample project and leave it at that.

  • Thats all I did was update my appicon files and it blew up – djack109 Sep 16 '22 at 17:55
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 17 '22 at 01:44