Darwin 的 Xamarin.Android 构建失败 - 无法编译本机程序集文件

问题描述 投票:0回答:0

我从模板创建了一个android项目。

当我构建项目时出现以下错误:

/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.26/tools/Xamarin.Android.Common.targets(3,3): Error XA3006: Could not compile native assembly file: environment.arm64-v8a.ll

stderr | /usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.26/tools/Darwin/binutils/bin/llc: error: /usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.26/tools/Darwin/binutils/bin/llc: environment.arm64-v8a.ll:554:7: error: expected value token
stderr |                 i32 −1, ; apk_fd

(XA3006) (AndroidApp1)

可能是什么问题?它适用于 .NET 6.

csproj:

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
    <TargetFramework>net7.0-android33.0.0</TargetFramework>
    <SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
    <OutputType>Exe</OutputType>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <ApplicationId>com.companyname.AndroidApp1</ApplicationId>
    <ApplicationVersion>1</ApplicationVersion>
    <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
    <TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
  <AndroidEnableMultiDex>false</AndroidEnableMultiDex>
  <AndroidPackageFormat>apk</AndroidPackageFormat>
</PropertyGroup>

我的系统:

.NET SDK:
Version:   7.0.202
Commit:    6c74320bc3

Runtime Environment:
OS Name:     Mac OS X
OS Version:  13.2
OS Platform: Darwin
RID:         osx.13-arm64
Base Path:   /usr/local/share/dotnet/sdk/7.0.202/

Host:
 Version:      7.0.4
 Architecture: arm64
 Commit:       0a396acafe

.NET SDKs installed:
 6.0.407 [/usr/local/share/dotnet/sdk]
 7.0.202 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
 Microsoft.AspNetCore.App 6.0.15 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 7.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
 Microsoft.NETCore.App 6.0.15 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
 Microsoft.NETCore.App 7.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
 x64   [/usr/local/share/dotnet/x64]
   registered at [/etc/dotnet/install_location_x64]

Environment variables:
Not set

global.json file:
Not found
xamarin.android visual-studio-2022 monodevelop .net-7.0 darwin
© www.soinside.com 2019 - 2024. All rights reserved.