添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Hi There, When I try to run the .Net Maui project on android Emulator I found run time error say that.

"Severity Code Description Project File Line Suppression State Priority

Error APT2062 failed linking references.C:\ ProgramFiles \dotnet \packs \Microsoft.Android.Sdk.Windows \33.0.46 \tools \Xamarin.Android.Aapt2.targets " I Not Found any fix for this error.

I tried to clean project and built again.

I tried to delete bin folder and obj. but it still exists.

Could you create a new project and run it? Do you get same error?

Do you share reproduced steps with us?

When rebuild your project without running your project in emulator, do you get this error?

Please share your visual studio version.

@Leon Lu (Shanghai Wicresoft Co,.Ltd.) Thanks for your interest.

  • when I create new project I did not found this error it run normal.
  • My project which has this problem is the result of Migration from Xamarin to Maui Dot NET .I fixed all problems which founded by the migration . just this error I can not fixed it.
  • yes when I build the project without running I get it .
  • I use Visual Studio 2022 Version 17.6.2.
  • Thanks Again
  • Could you share linker settings?

    Please open Tools tag->choose Options ->select Xamarin->Android settings-> set Diagnostic for Xamarin Diagnostic output verbosity. Then share the detailed build log here.

    Please try to use Command line dotnet build to build your project. Do you get the same error?

    Thanks for your feedback.

  • I did that Tools->choose Options ->select Xamarin->Android settings-> set Diagnostic for Xamarin Diagnostic output verbosity.
  • And used Command line to build my project . I have the same error
  • Error in command line say that res/values/values.xml(6): error APT2000: expected reference but got (raw string) #000000. :c\work\MAUI\MauiProject.csproj::TargetFramework=net7.0-android]
  • C:\ProgramFilesdotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\tools\Xamarin.Android.Aapt2.targets(156,3): error A

    PT2062: failed linking references. :\work\UI MAUI\MauiProject\mauiproje.csproj::TargetFramework=

    net7.0-android]

    I solved it by using Emulator that support google play like ** pixel 4(+store) **Emulator

    when choose it be sure to check the checkbox of Google play store

    Try it and tell me the result.