Forum Xamarin.Android

Could not AOT the assembly.. Xamarin Forms Android

JamesMallonJamesMallon USMember ✭✭
edited January 2019 in Xamarin.Android

Hi Guys,
I've been struggling with compiling my project with AOT Compile for the last 3 days. It's really important as reducing startup times is a massive requirement in this project. Whenever I go to build and deploy I get the following error multiple times: Could not AOT the assembly

The number of assemblies that I get the error message on seems to change every build + deploy this may also be caused by change to configuration.

Visual Studio Enterprise: v15.9.5
Xamarin Android v9.1.5.0
Build Mode: Release, Any CPU
Xamarin.Forms v3.40

Android Config:

Build Logs attached.



  • jezhjezh Member, Xamarin Team Xamurai

    We can see from the following image that AOT is still experimental by nature. Thus results may turn out to be unstable or in an unworking state

    From the link , we know

    AOT and AOT+LLVM support has always been experimental. It has been discovered that AOT+LLVM support hasn't worked since at least Xamarin.Android 6.0; the AOT+LLVM compiler executed but didn't do anything. During QA, it was determined that in attempting to fix the "AOT+LLVM didn't do anything" issue, the AOT+LLVM compiler instead crashed.
    Consequently, AOT+LLVM support has been disabled in the Xamarin.Android 6.1 release. It will be re-enabled in a future release.

  • JamesMallonJamesMallon USMember ✭✭

    Hi @jezh

    Thank you for taking the time to reply to this forum post. Unfortunately you are referring to Xamarin.Android 6.1 which was released 2015/2016 I believe. We are now in Xamarin.Android 9.1 and AOT is used by lots of different business' and individuals.

    For anyone reading this post I still have a few more ideas to try over the next week or so I will update here if I have any success. I believe it is due to compiling process of my core and shared libraries.

  • batmacibatmaci DEMember ✭✭✭✭✭
    edited January 2019

    was it working before? or you try first time. It could be 2 reasons. Visual Studio Enterprise: v15.9.5 or some changes in your app. if you installed a new nuget package or updated on a newer version. I remember that i had exactly same issue but i cant remember which one was the reason. because i am daily encountering such issues. especially Vs newer version always does such things. I am still on Visual Studio Enterprise: v15.9.4. for that reason i didnt upgraded it.

    i use exactly same configuration and it works fine for me on Visual Studio Enterprise: v15.9.4

  • batmacibatmaci DEMember ✭✭✭✭✭

    Did you already try to delete obj, bin, nuget cache, restart VS, rebuild and archieve? sometimes this is the way it works.

Sign In or Register to comment.