首页 > 解决方案 > 错误 MT3001:运行 Xamarin iOS 项目时无法 AOT 程序集

问题描述

我有一个 Xamarin .iOS 项目,它使用 GDAL(libgdal.a) 和 PROJ(libproj.a) 文件。

我正在尝试执行 iOS 项目并收到以下构建错误:

Target(s) <ProjectPath>/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/registrar.o must be rebuilt.
    <Path>/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -Wno-receiver-forward-class -Wno-objc-missing-super-calls -Wno-unguarded-availability-new -stdlib=libc++ -gdwarf-2 -std=c++14 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/14.10.0.4/SDKs/MonoTouch.iphoneos.sdk/include -isysroot <Path>/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk -Qunused-arguments -miphoneos-version-min=14.4 -arch arm64 -c -o “/<Path>/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/registrar.o" -x objective-c++ -D DEBUG “&lt;Path>/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/registrar.m"
    MTOUCH : error MT3001: Could not AOT the assembly '/Users/<username>/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build/OSGeo.GDAL.Test.iOS.exe'

笔记:

我的视觉工作室有以下版本

Visual Studio Community 2019 for Mac 版本 8.8.8(内部版本 12) Xamarin.Mac 6.18.0.23(d16-6 / 088c73638)Mono Framework MDK 运行时:Mono 6.12.0.113(2020-02/4fdfb5b1fd5)(64 位)NuGet 版本: 5.8.0.6860

.NET Core SDK SDK 版本:5.0.103 .NET Core 运行时 5.0.3 3.1.12 .NET Core 3.1 SDK:3.1.406

Xcode 12.4 (17801) Xamarin.Mac : 版本: 7.4.0.4 (Visual Studio Community) Xamarin.iOS 版本: 14.10.0.4 (Visual Studio Community) 操作系统 Mac OS X 10.16.0 Darwin 20.5.0 Darwin Kernel Version 20.5.0

另请查找构建日志的一部分

MONO_PATH='/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build' /Library/Frameworks/Xamarin.iOS.framework/Versions/14.20.0.24/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=-float32 "--aot=mtriple=arm64-ios,data-outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/MonoTouch.NUnitLite.aotdata.arm64,static,asmonly,direct-icalls,interp,full,dwarfdebug,no-direct-calls,outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/MonoTouch.NUnitLite.dll.s" "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build/MonoTouch.NUnitLite.dll"
    AOT : Unknown argument 'GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/MonoTouch.NUnitLite.aotdata.arm64'.
    AOT Compilation exited with code 1, command:
    MONO_PATH='/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build' /Library/Frameworks/Xamarin.iOS.framework/Versions/14.20.0.24/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=-float32 "--aot=mtriple=arm64-ios,data-outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/OSGeo.GDAL.Test.iOS.aotdata.arm64,static,asmonly,direct-icalls,interp,full,soft-debug,dwarfdebug,no-direct-calls,outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/OSGeo.GDAL.Test.iOS.exe.s" "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build/OSGeo.GDAL.Test.iOS.exe"
    AOT : Unknown argument 'GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/OSGeo.GDAL.Test.iOS.aotdata.arm64'.
    AOT Compilation exited with code 1, command:
    MONO_PATH='/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build' /Library/Frameworks/Xamarin.iOS.framework/Versions/14.20.0.24/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=-float32 "--aot=mtriple=arm64-ios,data-outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/System.Xml.aotdata.arm64,static,asmonly,direct-icalls,interp,full,dwarfdebug,no-direct-calls,outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/System.Xml.dll.s" "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build/System.Xml.dll"
    AOT : Unknown argument 'GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/System.Xml.aotdata.arm64'.
    AOT Compilation exited with code 1, command:
    MONO_PATH='/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build' /Library/Frameworks/Xamarin.iOS.framework/Versions/14.20.0.24/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=-float32 "--aot=mtriple=arm64-ios,data-outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/System.aotdata.arm64,static,asmonly,direct-icalls,interp,full,dwarfdebug,no-direct-calls,outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/System.dll.s" "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build/System.dll"
    AOT : Unknown argument 'GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/System.aotdata.arm64'.
    AOT Compilation exited with code 1, command:
    MONO_PATH='/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build' /Library/Frameworks/Xamarin.iOS.framework/Versions/14.20.0.24/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=-float32 "--aot=mtriple=arm64-ios,data-outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/Xamarin.iOS.aotdata.arm64,static,asmonly,direct-icalls,interp,full,dwarfdebug,no-direct-calls,outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/Xamarin.iOS.dll.s" "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build/Xamarin.iOS.dll"
    AOT : Unknown argument 'GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/Xamarin.iOS.aotdata.arm64'.
    AOT Compilation exited with code 1, command:
    MONO_PATH='/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build' /Library/Frameworks/Xamarin.iOS.framework/Versions/14.20.0.24/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=-float32 "--aot=mtriple=arm64-ios,data-outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/mscorlib.aotdata.arm64,static,asmonly,direct-icalls,interp,full,dwarfdebug,no-direct-calls,outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/mscorlib.dll.s" "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build/mscorlib.dll"
    AOT : Unknown argument 'GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/mscorlib.aotdata.arm64'.
    MONO_PATH='/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build' /Library/Frameworks/Xamarin.iOS.framework/Versions/14.20.0.24/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=-float32 "--aot=mtriple=arm64-ios,data-outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/MonoTouch.Dialog-1.aotdata.arm64,static,asmonly,direct-icalls,interp,full,dwarfdebug,no-direct-calls,outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/MonoTouch.Dialog-1.dll.s" "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build/MonoTouch.Dialog-1.dll"
    MONO_PATH='/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build' /Library/Frameworks/Xamarin.iOS.framework/Versions/14.20.0.24/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=-float32 "--aot=mtriple=arm64-ios,data-outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/OSGeo.GDAL.aotdata.arm64,static,asmonly,direct-icalls,interp,full,soft-debug,dwarfdebug,no-direct-calls,outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/OSGeo.GDAL.dll.s" "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build/OSGeo.GDAL.dll"
    Generating static registrar for MonoTouch.Dialog-1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065
    /Users/Dev/Downloads/XCode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -gdwarf-2 -std=c++14 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/14.20.0.24/SDKs/MonoTouch.iphoneos.sdk/include -isysroot /Users/Dev/Downloads/XCode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk -Qunused-arguments -miphoneos-version-min=14.5 -arch arm64 -c -o "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/main.o" -x objective-c++ -D MONOTOUCH -D DEBUG "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/main.m"
    Generating static registrar for OSGeo.GDAL, Version=1.0.7917.4345, Culture=neutral, PublicKeyToken=null
    AOT Compilation exited with code 1, command:
    MONO_PATH='/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build' /Library/Frameworks/Xamarin.iOS.framework/Versions/14.20.0.24/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=-float32 "--aot=mtriple=arm64-ios,data-outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/MonoTouch.Dialog-1.aotdata.arm64,static,asmonly,direct-icalls,interp,full,dwarfdebug,no-direct-calls,outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/MonoTouch.Dialog-1.dll.s" "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build/MonoTouch.Dialog-1.dll"
    AOT : Unknown argument 'GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/MonoTouch.Dialog-1.aotdata.arm64'.
    AOT Compilation exited with code 1, command:
    MONO_PATH='/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build' /Library/Frameworks/Xamarin.iOS.framework/Versions/14.20.0.24/bin/arm64-darwin-mono-sgen --debug -O=gsharedvt -O=-float32 "--aot=mtriple=arm64-ios,data-outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/OSGeo.GDAL.aotdata.arm64,static,asmonly,direct-icalls,interp,full,soft-debug,dwarfdebug,no-direct-calls,outfile=/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/OSGeo.GDAL.dll.s" "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build/OSGeo.GDAL.dll"
    AOT : Unknown argument 'GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/OSGeo.GDAL.aotdata.arm64'.
    File '/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/registrar.m' does not exist, creating it.
    File '/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/registrar.h' does not exist, creating it.
    Target(s) /Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/registrar.o must be rebuilt.
    /Users/Dev/Downloads/XCode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -Wno-receiver-forward-class -Wno-objc-missing-super-calls -Wno-unguarded-availability-new -stdlib=libc++ -gdwarf-2 -std=c++14 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/14.20.0.24/SDKs/MonoTouch.iphoneos.sdk/include -isysroot /Users/Dev/Downloads/XCode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk -Qunused-arguments -miphoneos-version-min=14.5 -arch arm64 -c -o "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/arm64/registrar.o" -x objective-c++ -D DEBUG "/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/registrar.m"
    MTOUCH : error MT3001: Could not AOT the assembly '/Users/Dev/Desktop/test proj/XamarinGeoTest/Lib/OSGeo,GDAL.Xamarin/OSGeo.GDAL.Test.iOS/obj/iPhone/Debug/device-builds/iphone10.6-14.7.1/mtouch-cache/3-Build/OSGeo.GDAL.Test.iOS.exe'
        

有人可以帮我解决这个问题吗?

标签: iosxamaringdalaot

解决方案


推荐阅读