maui: MAUI: Could not compile native assembly file: environment.arm64-v8a.ll

Description

Create .NET MAUI Project. I haven’t modified anything. While doing build getting compile time error - Could not compile native assembly file: environment.arm64-v8a.ll

Same issue I have found here and tried given solution still not working -

https://learn.microsoft.com/en-us/answers/questions/1199060/not-able-to-build-net7-0-android-project-in-vs-for?source=docs

Visual Studio -

Microsoft Visual Studio Professional 2022 Version 17.5.4 VisualStudio.17.Release/17.5.4+33530.505 Microsoft .NET Framework Version 4.8.04161

Installed Version: Professional

ASP.NET and Web Tools 17.5.318.41597 ASP.NET and Web Tools

C# Tools 4.5.2-3.23171.7+d17f741546fad2786cbd6394d08619544e53a36d C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Extensibility Message Bus 1.4.3 (main@2a4517a) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Mono Debugging for Visual Studio 17.5.9 (11975e6) Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 6.5.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core) 17.5.2.2316603+9f1b6856460af1e592d387ebef416eadddac453f Provides languages services for ASP.NET Core Razor.

Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio.

VisualStudio.DeviceLog 1.0 Information about my package

VisualStudio.Mac 1.0 Mac Extension for Visual Studio

VSPackage Extension 1.0 VSPackage Visual Studio Extension Detailed Info

Xamarin 17.5.0.173 (d17-5@33e727c) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 17.5.3.46 (remotes/origin/d17-5@e4dd80b2bb) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin.Android SDK 13.2.0.0 (d17-5/797e2e1) Xamarin.Android Reference Assemblies and MSBuild support. Mono: 6dd9def Java.Interop: xamarin/java.interop/main@149d70fe SQLite: xamarin/sqlite/3.40.0@fdc1e34 Xamarin.Android Tools: xamarin/xamarin-android-tools/main@9f02d77

Steps to Reproduce

  1. Create .NET MAUI Project
  2. Build it
  3. Getting compile time error

Expected behavior : Getting an error Actual behavior : Project should build successfully

Link to public reproduction project repository

NA

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 12

Did you find any workaround?

No

Relevant log output

Build started...
1>------ Build started: Project: MauiApp1, Configuration: Debug Any CPU ------
1>MauiApp1 -> C:\Users\source\repos\MauiApp1\MauiApp1\bin\Debug\net7.0-android\MauiApp1.dll
1>MauiApp1 -> C:\Users\source\repos\MauiApp1\MauiApp1\bin\Debug\net7.0-windows10.0.19041.0\win10-x64\MauiApp1.dll
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\tools\Xamarin.Android.Common.targets(1987,3): error XA3006: Could not compile native assembly file: environment.arm64-v8a.ll
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\tools\Xamarin.Android.Common.targets(1987,3): error XA3006: 
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\tools\Xamarin.Android.Common.targets(1987,3): error XA3006: 
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\tools\Xamarin.Android.Common.targets(1987,3): error XA3006:
1>Done building project "MauiApp1.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 11:38 AM and took 03.857 seconds ==========

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 133 (16 by maintainers)

Commits related to this issue

Most upvoted comments

@arvindrajachourasiya I copied the lld.exe file and renamed the copy ld.exe. I then overwrote the existing ld.exe file with the new file. That worked for me.

Thank you for all your help @grendello!

I see this error on a Xamarin.Forms project as soon as I update it any further than 17.4 release, if that helps. Anything below builds the android projects just fine.

Could you please let me know what folders/files I might need to mention in my request to exclude them ? I will help me. Thank you.

I would normally add an exclusion for my entire “work” directory. So if I generally check out all my source code to say `c:\Work’. Then I’d add ‘c:\Work’ as an exclusion.