question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When I try to compile and run the MAUI project, I get an APT2000 error

See original GitHub issue

Description

I am in the process of developing my mobile application on MAUI. Just recently I finished some of the development on my home PC and uploaded everything to the GitHub repository. After some time away, I decided to continue working on the project on my laptop. My laptop was not configured for android emulation, so I did everything as per the tutorial: enabled Hyper-V components, in the Visual Studio 2022 Tools tab -> Android -> Android SDK Manager. After opening the Android SDK Manager, I installed the following components (screenshot 1): screenshot 1 P.s. I apologize, most of the interface will be in Russian, but I will try to translate it when necessary After installing the emulator, I proceeded to set up the device that I will emulate. I chose the default option, i.e. Pixel 5 on Android 13. I didn’t change anything in its settings. After installing this image, I decided to run the project, but I was constantly getting APT2000 error, even if I connected my phone via USB.

I tried reinstalling the Android emulator and also reinstalling the emulated device. I tried uninstalling and downloading the project from GitHub and launching it. I tried running the project and emulating it through my Android phone. I expected that the project will start as it should always start for everyone, i.e. it opens the application on the emulated device and displays the interface and application logic, but it didn’t happen

P.s. The problem itself was posted by me back on Stack Overflow, however even there, there was no similar problem to mine

Steps to Reproduce

  1. Create a new MAUI project
  2. Configure the Android emulator using the Android SDK and Android Device Manager
  3. Try to get the project up and running

Expected outcome: Started and running application with initial template, which is set by default by MAUI developers Actual outcome: “Error APT2000 Cannot find the specified file. (2). -> MyAppName -> C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\tools\Xamarin.Android.Aapt2.targets -> 212”

Link to public reproduction project repository

https://github.com/TungusSs/BelfertApp/tree/feature-branch

Version with bug

7.0.86

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 13

Did you find any workaround?

Unfortunately, no.

Relevant log output

Error APT2000 Cannot find the specified file. (2). -> MyAppName -> C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\tools\Xamarin.Android.Aapt2.targets -> 212

Issue Analytics

  • State:closed
  • Created 2 months ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jonathanpepperscommented, Jul 12, 2023

Ok, great! I do think it’s the same known issue I linked above. We have some ideas on invoking aapt2 in a different way to work around this problem, but I’m not sure when we’ll get that in.

0reactions
jonathanpepperscommented, Jul 12, 2023
Read more comments on GitHub >

github_iconTop Results From Across the Web

When I try to compile and run the MAUI project, I get ...
According to this issue about Android - APT2000 build error when project path contains non-ASCII symbols, please make sure your maui project ...
Read more >
How to fix Severity Code APT2062 failed linking references.
Hi There, When I try to run the .Net Maui project on android Emulator I found run time error say that. "Severity Code...
Read more >
Error (failed to open directory: the system cannot find ...
i have tried making a replication project but with no succes. This error persists and I am unable to identify the issue. The...
Read more >
Untitled
Android - APT2000 build error when project path contains … WebDec 27, 2021 · I didn't find any problems running a MAUI app...
Read more >
How to Fix Error XA0137 The 'run as' command failed in ...
I'm getting following error Deployment issue with Fast Deployment ... studio, Error xao137 xamarin forms,Fix error XA0137 run as command,Fix ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found