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

2

7

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.

Polik answered 11/10, 2019 at 21:47 Comment(0)
P
3

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.

Polik answered 21/10, 2019 at 23:22 Comment(0)
A
2

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

Abortifacient answered 12/10, 2019 at 20:54 Comment(4)
I tried Supported Architectures: ARM64 only, but unfortunately I get the same error. I updated Visual Studio Pro 2019 to 16.3.5, and the latest components on the Mac.Polik
Did you tried delete/obj folder and clean/rebuild again? Also, try to reinstall ZXingNetMobile SDK. If the problem still exist, you can open a new issue onGithub with your build logs for more help.Rounds
@JackHua-MSFT I've done what you suggest, deleted bin/obj, clean and rebuild but nothing different, the error keeps.Scever
@ViniciusDutra You can open a free Xamarin support case here:xamarin supportRounds

© 2022 - 2024 — McMap. All rights reserved.