Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Forms - iOS - error MT3001: Could not AOT the assembly

Xamarin Forms iOS project was building yesterday 10/10/19. Updated to latest components on Mac & Windows today, project no longer builds.

Build: Release - iPhone - TestMobile.iOS - Device

Project works on Mac simulator. Project deploys & debugs on iPhone hardware.

  • Visual Studio Pro 2019 - 16.3.4
  • Visual Studio 2019 for Mac - 8.3.3 build 8
  • all components latest on Mac
  • MacOS Catalina 10.15

Build Log:

3>  AOT Compilation exited with code 1, command:
3>  MONO_PATH=/Users/bob/Library/Caches/Xamarin/mtbs/builds/TestMobileXF.iOS/e5f1c3a4936492ad245f1c68c3157dfc/C:/Temp/iOS/mtouch-cache/32/3-Build /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/bin/arm-darwin-mono-sgen --debug -O=gsharedvt -O=-float32  --aot=mtriple=armv7-ios,data-outfile=/Users/bob/Library/Caches/Xamarin/mtbs/builds/TestMobileXF.iOS/e5f1c3a4936492ad245f1c68c3157dfc/C:/Temp/iOS/mtouch-cache/armv7/ZXingNetMobile.aotdata.armv7,static,asmonly,direct-icalls,full,soft-debug,dwarfdebug,no-direct-calls,outfile=/Users/bob/Library/Caches/Xamarin/mtbs/builds/TestMobileXF.iOS/e5f1c3a4936492ad245f1c68c3157dfc/C:/Temp/iOS/mtouch-cache/armv7/ZXingNetMobile.dll.s "/Users/bob/Library/Caches/Xamarin/mtbs/builds/TestMobileXF.iOS/e5f1c3a4936492ad245f1c68c3157dfc/C:/Temp/iOS/mtouch-cache/32/3-Build/ZXingNetMobile.dll"
3>  '/Users/bob/Library/Caches/Xamarin/mtbs/builds/TestMobileXF.iOS/e5f1c3a4936492ad245f1c68c3157dfc/C' in MONO_PATH doesn't exist or has wrong permissions.
3>  '/Temp/iOS/mtouch-cache/32/3-Build' in MONO_PATH doesn't exist or has wrong permissions.
3>  The assembly mscorlib.dll was not found or could not be loaded.
3>  It should have been installed in the `/Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/sdks/out/ios-cross32-release/lib/mono/4.5/mscorlib.dll' directory.
3>  /Applications/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/13.4.0.2/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.1.sdk -Qunused-arguments -miphoneos-version-min=8.0 -arch arm64 -c -o /Users/bob/Library/Caches/Xamarin/mtbs/builds/TestMobileXF.iOS/e5f1c3a4936492ad245f1c68c3157dfc/C:/Temp/iOS/mtouch-cache/arm64/registrar.o -x objective-c++ -DDEBUG /Users/bob/Library/Caches/Xamarin/mtbs/builds/TestMobileXF.iOS/e5f1c3a4936492ad245f1c68c3157dfc/C:/Temp/iOS/mtouch-cache/64/registrar.m

3>  C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(842,3): 
error MT3001: Could not AOT the assembly '/Users/bob/Library/Caches/Xamarin/mtbs/builds/TestMobileXF.iOS/e5f1c3a4936492ad245f1c68c3157dfc/C:/Temp/iOS/mtouch-cache/64/3-Build/TestMobileXF.iOS.exe'

Tried iOS Build settings:

  • Linker Behavior
  • Supported Architectures
  • LLVM compiler
  • Incremental builds

Reverting Visual Studio Pro 2019 is a last resort. Any ideas appreciated.

like image 614
MBDev Avatar asked Oct 11 '19 21:10

MBDev


2 Answers

Found the issue. Set this in the iOS.csproj file, for the iPhone - Release profile:

<IntermediateOutputPath>obj\iPhone\ReleaseTemp</IntermediateOutputPath>

link link

I was seeing "MONO_PATH doesn't exist or has wrong permissions" in the verbose build logs.

The project now builds, and I can create an Archive, and see the IPA file on the Mac.

like image 171
MBDev Avatar answered Nov 17 '22 21:11

MBDev


Change the architecture to ARM64 only, it will build sucessfully.

See here: https://github.com/xamarin/xamarin-macios/issues/6925

The reason this fails is that the 32-bit AOT compilers that are shipping with Xamarin.iOS 12.99 (and 13.0) are themselves 32-bit binaries, and 32-bit binaries won't execute on macOS 10.15 Catalina.

Hope this helps

like image 24
Iain STIRZAKER Avatar answered Nov 17 '22 22:11

Iain STIRZAKER