Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AndroidManifest.xml file doesn't exist in default MAUI project

I have created the MAUI project according to the getting started guide:

  • Installation
  • Build your first app

It is a default project without any changes. Now, I am trying to build my project and I get the next errors:

  • Specified AndroidManifest file does not exist: C:\***\source\repos\MauiApp\MauiApp\AndroidManifest.xml.
  • Assets file 'C:\***\source\repos\MauiApp\MauiApp\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.

I have tried to restore NuGet but it doesn't help. What did I miss? or any suggestion for fixing?

EDIT:

  • Windows 10 Pro,19043.1237
  • Visual Studio Community 2022 Preview, 17.0.0 Preview 5.0
like image 959
RredCat Avatar asked Jan 25 '26 01:01

RredCat


1 Answers

I have this solved, ...well, kind of. Let me explain: I have got a solution with 18 projects, three of them are MAUI projects targeting just net8.0-android. All three projects suddenly started to produce the XA1018 error:

XA1018  Specified AndroidManifest file does not exist: <MauiProjectFolder>\AndroidManifest.xml.

In addition, the projects also produce the NU1008 error:

NU1008: Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items...

Although the central package version management is setup correctly (it already worked as stated in my previous comment).

What solved the issue for me (at least temporarily) was the following:

  1. Copy the AndroidManifest.xml file from the Platforms/Android subfolder into the project's root folder for each affected MAUI project.
  2. Rebuild solution - should be rebuilt successfully.
  3. Now you can remove the AndroidManifest.xml files form the MAUI project's root folder and VS (or MSBuild, I do not know which one) does not complain anymore.

This is insane!

like image 172
Palo Mraz Avatar answered Jan 26 '26 15:01

Palo Mraz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!