问题描述
我创建了新项目xamarin protable.我没有在项目中添加其他代码.
I created new project xamarin forms protable. I didn't add other code in projects.
当我使用AOT选项构建Android项目时,出现错误:
When I build Android project with AOT options I get error:
[AOT] E:\works\xamarin\projects\TestAot\TestAot\TestAot.Droid\obj\Release\android\assets\TestAot.Droid.dll
Could not AOT the assembly: obj\Release\android\assets\TestAot.Droid.dll
Xamarin.VS和Android SDK已更新为最新版本.
Xamarin.VS and Android SDK updated to last versions.
如何解决?谢谢.
推荐答案
如果您将llvm和aot一起启用,它只会给您上述错误.有人说,当您在64位Windows上进行编译时会发生这种情况,而在云中进行编译就可以了.无论如何,有一个解决方案,基本上禁用了'embedassembliesintoapk':
Faced that if you enable llvm along with aot, it just gives you the above error. Some say it happens when you are compiling on a 64-bit windows, while compiling in cloud works fine. Anyway there's a solution, basically disabling the 'embedassembliesintoapk':
以上设置对我来说很好.
The above settings work fine for me.
请考虑aot + llvm可以使应用程序启动时间比单独使用aot更长.
Consider that aot+llvm can have an app startup time longer than with aot alone.
信用: https://forums.xamarin.com/discussion/comment/302015/#Comment_302015
这篇关于Build Xamarin.Android无法与AOT一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!