简体   繁体   中英

Could not AOT the assembly for Microsoft.CSharp.dll on Xamarin.iOS

When I try to build my Xamarin iOS project, I get the error : " Could not AOT the assembly '/Users/xxx/Library/Caches/Xamarin/mtbs/builds/myApp.iOS/hugeNumbers/obj/iPhone/Debug/mtouch-cache/3-Build/Microsoft.CSharp.dll' "

I've found in some other posts this is due to the package Newtonsoft.Json, but it is supposed to be fixed since a while ago.

I am trying to build my project on Visual Studio 2019 on Windows, synchronized with my Mac in order to launch on iPhone.

Any help please ?

Thanks to Lex Li, here are the steps that made it works for me :

1- Download from here a installer for AOT (available for Visual Studio 2019 and Visual Studio for Mac 8.0

2- Launch the installer and follow the steps

3- On your project Xamarin.iOS (myApp.iOS), right click > settings

4- Go to Build iOS, and at the bottom of the page, add " --interpreter " in the section Additional mtouch arguments

5- Build again, and it should work.

Try this : Delete the app on phone or emulator. Clean and rebuild solutions. The redeploy again.

<MtouchExtraArgs>--interpreter=FSharp.Core ...</MtouchExtraArgs>
<MtouchInterpreter>-all</MtouchInterpreter>

and

<MtouchExtraArgs>--linkskip=FSharp.Core ...</MtouchExtraArgs>

both work for me in https://github.com/xperiandri/Elmish.Uno/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM