Could not AOT the assembly of my App

David Perera 11 Reputation points
2021-05-14T20:07:04.643+00:00

Hello,

I have an app written in xamarin forms, targeting xamarin.android and xamarin.iOS. Since the UIWebView deprecation https://devblogs.microsoft.com/xamarin/uiwebview-deprecation-xamarin-forms/, I have upgraded my app from Xamarin Forms 3.0 to Xamarin.Forms 5.0.

Now I get the following error when deploying in Release for AppStore (in debug everything works fine since the compilation is JIT):

C:\cicdev\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(421,3): error MT3001: Could not AOT the assembly '/Users/idboxrt/Library/Caches/Xamarin/mtbs/builds/IDboxMobile.iOS/e86aa7b5295e9875bca66b5cd69c66e6eb0c2469c92d74f31f9c313ee00733b4/obj/iPhone/ReleaseTemp/mtouch-cache/3-Build/IDboxMobile.dll'

IDboxMobile.dll is the dll of my NetStandard shared application which targets my IDboxMobile.iOS target.

I attach the log in a .zip (please change the .txt to .zip in the attached file)

I have updated xamarin.iOS, xcode and visual studio to their latest versions today. Thge Supported Architecture is ARM64. I tried to change the linker options, LLVM, Enable Mono Interpreter, and so on.

Also put the verbosity of the log attached in "-v -v -v -v", but I cannot get more info about the AOT, just that it fails.

Thank you very much in advance.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,297 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. JarvanZhang 23,951 Reputation points
    2021-05-17T08:48:06.1+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    IOS applications have had a number of limitations when running on a device. Even using Ahead of Time” (AOT), It can also restrict a number of C# features from being used. To avoid this, try using the interpreter function.

    Check the tutorial: https://devblogs.microsoft.com/xamarin/introducing-xamarin-ios-interpreter/

    Someone faced the similar problem and solved the issue by configuring the MtouchExtraArgs tag.

       <MtouchExtraArgs>--interpreter=the_assembly ...</MtouchExtraArgs>  
       <MtouchInterpreter>-all</MtouchInterpreter>  
         
       //or  
       <MtouchExtraArgs>--linkskip=the_assembly  ...</MtouchExtraArgs>  
    

    Please check: https://stackoverflow.com/a/65809789/11083277

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.