Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$(AndroidAddKeepAlives)=True results in XA3001 error with Square.OkHttp3.dll #5764

Closed
lassana opened this issue Mar 22, 2021 · 35 comments
Closed
Labels
Area: App+Library Build Issues when building Library projects or Application projects. Area: Mono Runtime Mono-related issues: BCL bugs, AOT issues, etc. vs-sync For internal use only; creates a VSTS "mirror" issue.

Comments

@lassana
Copy link

lassana commented Mar 22, 2021

Steps to Reproduce

  1. Open attached Xamarin.Android project in VS for Mac
  2. Try to "Archive for Publishing" with the Release configuration

It was working correctly until a recent Xamarin update. As a workaround you can set EnableLLVM to False.

XamarinLlvmIssue.zip

Expected Behavior

The app builds.

Actual Behavior

It fails with: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error XA3001: Could not AOT the assembly: Square.OkHttp3.dll (XA3001) (XamarinLlvmIssue)

Version Information

About Visual Studio
Visual Studio Community 2019 for Mac
Version 8.9.2 (build 0)
Installation UUID: 3fa90cee-79c4-4b50-93fb-cfc2f09b209a
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

	Package version: 612000125

Mono Framework MDK
Runtime:
	Mono 6.12.0.125 (2020-02/8c552e98bd6) (64-bit)
	Package version: 612000125

Roslyn (Language Service)
3.9.0-6.21152.10+c10f884b30737542ddd84ca889a4aad9281ce210

NuGet
Version: 5.8.0.6860

.NET Core SDK
SDK: /usr/local/share/dotnet/sdk/5.0.201/Sdks
SDK Versions:
	5.0.201
	5.0.103
	3.1.407
	3.1.406
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

.NET Core Runtime
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	5.0.4
	5.0.3
	3.1.13
	3.1.12

.NET Core 3.1 SDK
SDK: 3.1.407

Xamarin.Profiler
Version: 1.6.12.26
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Xamarin.Android
Version: 11.2.2.1 (Visual Studio Community)
Commit: xamarin-android/d16-9/877f572
Android SDK: /usr/local/share/android-sdk/
	Supported Android versions:
		8.0 (API level 26)
		8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.5
SDK Build Tools Version: 30.0.3

Build Information: 
Mono: 5e9cb6d
Java.Interop: xamarin/java.interop/d16-9@54f8c24
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.34.1@daff8f4
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-9@d210f11

Microsoft OpenJDK for Mobile
Java SDK: /Users/user/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 16.9.0.22
Hash: a391de2
Branch: remotes/origin/d16-9
Build date: 2021-03-05 19:52:30 UTC

Android Device Manager
Version: 16.9.0.17
Hash: fc2b3db
Branch: remotes/origin/d16-9
Build date: 2021-03-05 19:52:54 UTC

Apple Developer Tools
Xcode 12.4 (17801)
Build 12D4e

Xamarin.Mac
Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

Xamarin.iOS
Version: 14.14.2.5 (Visual Studio Community)
Hash: 3836759d4
Branch: d16-9
Build date: 2021-02-10 17:56:44-0500

Xamarin Designer
Version: 16.9.0.316
Hash: 2241b204a
Branch: tags/vsm-rel/d16.9-4540908
Build date: 2021-03-10 22:18:10 UTC

Build Information
Release ID: 809020000
Git revision: a69906fb0095d046b113a63419c9af3034ce104e
Build date: 2021-03-11 14:01:37-05
Build branch: release-8.9
Xamarin extensions: a69906fb0095d046b113a63419c9af3034ce104e

Operating System
Mac OS X 10.15.7
Darwin 19.6.0 Darwin Kernel Version 19.6.0
    Tue Jan 12 22:13:05 PST 2021
    root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64

Enabled user installed extensions
DeepClean 1.2.5
NuGet Package Explorer 0.5
Eto.Forms Support Addin 2.5.6

Log File

Archive output

Building XamarinLlvmIssue (Release)


Creating archive directory 'XamarinLlvmIssue'...


Packaging 'XamarinLlvmIssue'...
Build started 3/22/2021 8:13:59 PM.
__________________________________________________
Project "/Users/user/Desktop/XamarinLlvmIssue/XamarinLlvmIssue.csproj" (PackageForAndroid target(s)):

Target _ResolveAndroidTooling:
    Found Java SDK version 1.8.0.
    Found Java SDK version 1.8.0.
Target _ValidateAndroidPackageProperties:
      PackageName: com.example.xamarinllvmissue
Target _CheckInstantRunCondition:
    Dex Fast Deployment Enabled: False
Target _ResolveMonoAndroidSdks:
    MonoAndroid Tools: /Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/
    Android Platform API level: 30
    TargetFrameworkVersion: v11.0
    Android NDK: /usr/local/share/android-ndk/
    Android SDK: /usr/local/share/android-sdk/
    Android SDK Build Tools: /usr/local/share/android-sdk/build-tools/30.0.2/
    Java SDK: /Users/user/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25/
    Application Java class: android.app.Application
Target _CleanIntermediateIfNeeded:
  Skipping target "_CleanIntermediateIfNeeded" because all output files are up-to-date with respect to the input files.
Target _ResolveLibraryProjectImports:
  Skipping target "_ResolveLibraryProjectImports" because all output files are up-to-date with respect to the input files.
Target _BuildLibraryImportsCache:
  Skipping target "_BuildLibraryImportsCache" because all output files are up-to-date with respect to the input files.
Target _GenerateLayoutBindings:
  Skipping target "_GenerateLayoutBindings" because it has no outputs.
Target _ConvertResourcesCases:
  Skipping target "_ConvertResourcesCases" because all output files are up-to-date with respect to the input files.
Target _CompileResources:
  Skipping target "_CompileResources" because all output files are up-to-date with respect to the input files.
Target _PrepareUpdateAndroidResgen:
  Skipping target "_PrepareUpdateAndroidResgen" because all output files are up-to-date with respect to the input files.
Target _UpdateAndroidResgen:
  Skipping target "_UpdateAndroidResgen" because all output files are up-to-date with respect to the input files.
Target GenerateTargetFrameworkMonikerAttribute:
  Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
Target CoreCompile:
  Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
Target CopyFilesToOutputDirectory:
    XamarinLlvmIssue -> /Users/user/Desktop/XamarinLlvmIssue/bin/Release/XamarinLlvmIssue.dll
Target _ResolveAssemblies:
      Adding assembly reference for XamarinLlvmIssue, recursively...
      Adding assembly reference for Java.Interop, recursively...
      Adding assembly reference for Mono.Android, recursively...
        Adding assembly reference for System.Net.Http, recursively...
        Adding assembly reference for System.Drawing.Common, recursively...
        Adding assembly reference for System.Runtime.Serialization, recursively...
          Adding assembly reference for System.ServiceModel.Internals, recursively...
      Adding assembly reference for mscorlib, recursively...
      Adding assembly reference for Square.OkHttp3, recursively...
      Adding assembly reference for Square.OkIO, recursively...
      Adding assembly reference for System.Core, recursively...
      Adding assembly reference for System, recursively...
        Adding assembly reference for Mono.Security, recursively...
      Adding assembly reference for System.Numerics, recursively...
      Adding assembly reference for System.Numerics.Vectors, recursively...
      Adding assembly reference for System.Runtime, recursively...
        Adding assembly reference for System.ComponentModel.Composition, recursively...
      Adding assembly reference for System.Xml, recursively...
      Adding assembly reference for Xamarin.AndroidX.Activity, recursively...
      Adding assembly reference for Xamarin.AndroidX.Annotation, recursively...
      Adding assembly reference for Xamarin.AndroidX.AppCompat.AppCompatResources, recursively...
      Adding assembly reference for Xamarin.AndroidX.AppCompat, recursively...
      Adding assembly reference for Xamarin.AndroidX.Arch.Core.Common, recursively...
      Adding assembly reference for Xamarin.AndroidX.Arch.Core.Runtime, recursively...
      Adding assembly reference for Xamarin.AndroidX.AsyncLayoutInflater, recursively...
      Adding assembly reference for Xamarin.AndroidX.Browser, recursively...
      Adding assembly reference for Xamarin.AndroidX.CardView, recursively...
      Adding assembly reference for Xamarin.AndroidX.Collection, recursively...
      Adding assembly reference for Xamarin.AndroidX.CoordinatorLayout, recursively...
      Adding assembly reference for Xamarin.AndroidX.Core, recursively...
      Adding assembly reference for Xamarin.AndroidX.CursorAdapter, recursively...
      Adding assembly reference for Xamarin.AndroidX.CustomView, recursively...
      Adding assembly reference for Xamarin.AndroidX.DocumentFile, recursively...
      Adding assembly reference for Xamarin.AndroidX.DrawerLayout, recursively...
      Adding assembly reference for Xamarin.AndroidX.Fragment, recursively...
      Adding assembly reference for Xamarin.AndroidX.Interpolator, recursively...
      Adding assembly reference for Xamarin.AndroidX.Legacy.Support.Core.UI, recursively...
      Adding assembly reference for Xamarin.AndroidX.Legacy.Support.Core.Utils, recursively...
      Adding assembly reference for Xamarin.AndroidX.Lifecycle.Common, recursively...
      Adding assembly reference for Xamarin.AndroidX.Lifecycle.LiveData.Core, recursively...
      Adding assembly reference for Xamarin.AndroidX.Lifecycle.Runtime, recursively...
      Adding assembly reference for Xamarin.AndroidX.Lifecycle.ViewModel, recursively...
      Adding assembly reference for Xamarin.AndroidX.Lifecycle.ViewModelSavedState, recursively...
      Adding assembly reference for Xamarin.AndroidX.Loader, recursively...
      Adding assembly reference for Xamarin.AndroidX.LocalBroadcastManager, recursively...
      Adding assembly reference for Xamarin.AndroidX.MultiDex, recursively...
      Adding assembly reference for Xamarin.AndroidX.Print, recursively...
      Adding assembly reference for Xamarin.AndroidX.RecyclerView, recursively...
      Adding assembly reference for Xamarin.AndroidX.SavedState, recursively...
      Adding assembly reference for Xamarin.AndroidX.SlidingPaneLayout, recursively...
      Adding assembly reference for Xamarin.AndroidX.SwipeRefreshLayout, recursively...
      Adding assembly reference for Xamarin.AndroidX.Transition, recursively...
      Adding assembly reference for Xamarin.AndroidX.VectorDrawable.Animated, recursively...
      Adding assembly reference for Xamarin.AndroidX.VectorDrawable, recursively...
      Adding assembly reference for Xamarin.AndroidX.VersionedParcelable, recursively...
      Adding assembly reference for Xamarin.AndroidX.ViewPager, recursively...
      Adding assembly reference for Xamarin.Essentials, recursively...
      Adding assembly reference for Xamarin.Google.Android.Material, recursively...
      Adding assembly reference for Xamarin.Google.Guava.ListenableFuture, recursively...
Target _CopyConfigFiles:
  Skipping target "_CopyConfigFiles" because it has no inputs.
Target _ConvertPdbFiles:
  Skipping target "_ConvertPdbFiles" because it has no outputs.
Target _LinkAssembliesShrink:
  Skipping target "_LinkAssembliesShrink" because all output files are up-to-date with respect to the input files.
Target _GenerateJavaStubs:
  Skipping target "_GenerateJavaStubs" because all output files are up-to-date with respect to the input files.
Target _ManifestMerger:
  Skipping target "_ManifestMerger" because all output files are up-to-date with respect to the input files.
Target _ConvertCustomView:
  Skipping target "_ConvertCustomView" because all output files are up-to-date with respect to the input files.
Target _AddStaticResources:
  Skipping target "_AddStaticResources" because all output files are up-to-date with respect to the input files.
Target _GeneratePackageManagerJava:
  Skipping target "_GeneratePackageManagerJava" because all output files are up-to-date with respect to the input files.
Target _GenerateAndroidAssetsDir:
  Skipping target "_GenerateAndroidAssetsDir" because it has no outputs.
Target _PrepareCreateBaseApk:
  Skipping target "_PrepareCreateBaseApk" because all output files are up-to-date with respect to the input files.
Target _CreateBaseApk:
  Skipping target "_CreateBaseApk" because all output files are up-to-date with respect to the input files.
Target _CompileJava:
  Skipping target "_CompileJava" because all output files are up-to-date with respect to the input files.
Target _CompileNativeAssemblySources:
  Skipping target "_CompileNativeAssemblySources" because all output files are up-to-date with respect to the input files.
Target _CreateApplicationSharedLibraries:
  Skipping target "_CreateApplicationSharedLibraries" because all output files are up-to-date with respect to the input files.
Target _CompileToDalvik:
  Skipping target "_CompileToDalvik" because all output files are up-to-date with respect to the input files.
Target _RemoveRegisterAttribute:
    Creating "obj/Release/android/assets/shrunk/shrunk.flag" because "AlwaysCreate" was specified.
Target _CopyConfigFiles:
  Skipping target "_CopyConfigFiles" because it has no inputs.
Target _ConvertPdbFiles:
  Skipping target "_ConvertPdbFiles" because it has no outputs.
Target _BuildApkEmbed:
    [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/Square.OkIO.dll
    [aot-compiler stdout] AOTID E7518095-5830-66EB-955A-93571BEC0C62
    [aot-compiler stdout] Executing opt: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "obj/Release/aot/armeabi-v7a/Square.OkIO.dll/temp.opt.bc" "obj/Release/aot/armeabi-v7a/Square.OkIO.dll/temp.bc"
    [aot-compiler stdout] Executing llc: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/llc"  -enable-implicit-null-checks -disable-fault-maps -mattr=+vfp2,-neon,+d16 -asm-verbose=false -mtriple=armv7-linux-gnueabi -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=mono_aot_Square_OkIO_eh_frame -disable-tail-calls -relocation-model=pic -o "obj/Release/aot/armeabi-v7a/Square.OkIO.dll/temp-llvm.s" "obj/Release/aot/armeabi-v7a/Square.OkIO.dll/temp.opt.bc"
    [aot-compiler stdout] Compiled: 672/672
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Square.OkIO.dll/temp.s.o obj/Release/aot/armeabi-v7a/Square.OkIO.dll/temp.s
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Square.OkIO.dll/temp-llvm.o obj/Release/aot/armeabi-v7a/Square.OkIO.dll/temp-llvm.s
    [aot-compiler stdout] Executing the native linker: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld" -Bsymbolic -shared -o obj/Release/aot/armeabi-v7a/libaot-Square.OkIO.dll.so.tmp "obj/Release/aot/armeabi-v7a/Square.OkIO.dll/temp-llvm.o" obj/Release/aot/armeabi-v7a/Square.OkIO.dll/temp.s.o "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libc.so" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libm.so"
    [aot-compiler stdout] Stripping the binary: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d obj/Release/aot/armeabi-v7a/libaot-Square.OkIO.dll.so.tmp
    [aot-compiler stdout] JIT time: 346 ms, Generation time: 3845 ms, Assembly+Link time: 177 ms.
    [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/Square.OkHttp3.dll
    [aot-compiler stdout] AOTID C3AD85CB-5B6D-9D3B-A3FD-95FF961A4FA9
    [aot-compiler stdout] Executing opt: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "obj/Release/aot/armeabi-v7a/Square.OkHttp3.dll/temp.opt.bc" "obj/Release/aot/armeabi-v7a/Square.OkHttp3.dll/temp.bc"
    [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/Xamarin.AndroidX.CardView.dll
    [aot-compiler stdout] AOTID 0F8B03E1-5158-3AC1-36D4-6A271A388B3C
    [aot-compiler stdout] Executing opt: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.CardView.dll/temp.opt.bc" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.CardView.dll/temp.bc"
    [aot-compiler stdout] Executing llc: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/llc"  -enable-implicit-null-checks -disable-fault-maps -mattr=+vfp2,-neon,+d16 -asm-verbose=false -mtriple=armv7-linux-gnueabi -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=mono_aot_Xamarin_AndroidX_CardView_eh_frame -disable-tail-calls -relocation-model=pic -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.CardView.dll/temp-llvm.s" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.CardView.dll/temp.opt.bc"
    [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/System.Numerics.dll
    [aot-compiler stdout] Compiled: 9/9
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.CardView.dll/temp.s.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.CardView.dll/temp.s
    [aot-compiler stdout] AOTID DF7F886B-8531-FEB6-6E38-53F3F5AA1594
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.CardView.dll/temp-llvm.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.CardView.dll/temp-llvm.s
    [aot-compiler stderr] Basic Block in function 'Square_OkHttp3_Address__ctor_string_int_Square_OkHttp3_IDns_Javax_Net_SocketFactory_Javax_Net_Ssl_SSLSocketFactory_Javax_Net_Ssl_IHostnameVerifier_Square_OkHttp3_CertificatePinner_Square_OkHttp3_IAuthenticator_Java_Net_Proxy_System_Collections_Generic_IList_1_Square_OkHttp3_Protocol_System_Collections_Generic_IList_1_Square_OkHttp3_ConnectionSpec_Java_Net_ProxySelector' does not have terminator!
    [aot-compiler stdout] Executing opt: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "obj/Release/aot/armeabi-v7a/System.Numerics.dll/temp.opt.bc" "obj/Release/aot/armeabi-v7a/System.Numerics.dll/temp.bc"
    [aot-compiler stdout] Executing the native linker: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld" -Bsymbolic -shared -o obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.CardView.dll.so.tmp "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.CardView.dll/temp-llvm.o" obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.CardView.dll/temp.s.o "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libc.so" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libm.so"
    [aot-compiler stderr] label %NOTINITED_BB35
    [aot-compiler stdout] Stripping the binary: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.CardView.dll.so.tmp
    [aot-compiler stderr] LLVM ERROR: Broken module found, compilation aborted!
    [aot-compiler stdout] JIT time: 50 ms, Generation time: 78 ms, Assembly+Link time: 70 ms.
    [aot-compiler stdout] Executing llc: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/llc"  -enable-implicit-null-checks -disable-fault-maps -mattr=+vfp2,-neon,+d16 -asm-verbose=false -mtriple=armv7-linux-gnueabi -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=mono_aot_System_Numerics_eh_frame -disable-tail-calls -relocation-model=pic -o "obj/Release/aot/armeabi-v7a/System.Numerics.dll/temp-llvm.s" "obj/Release/aot/armeabi-v7a/System.Numerics.dll/temp.opt.bc"
    [aot-compiler stderr] AOT of image /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/Square.OkHttp3.dll failed.
    [aot-compiler stdout] Compiled: 81/81
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/System.Numerics.dll/temp.s.o obj/Release/aot/armeabi-v7a/System.Numerics.dll/temp.s
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/System.Numerics.dll/temp-llvm.o obj/Release/aot/armeabi-v7a/System.Numerics.dll/temp-llvm.s
    [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/Xamarin.AndroidX.Annotation.dll
    [aot-compiler stdout] AOTID D39E605A-AE71-0FC2-5F3B-2B0F6FE62814
    [aot-compiler stdout] Executing the native linker: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld" -Bsymbolic -shared -o obj/Release/aot/armeabi-v7a/libaot-System.Numerics.dll.so.tmp "obj/Release/aot/armeabi-v7a/System.Numerics.dll/temp-llvm.o" obj/Release/aot/armeabi-v7a/System.Numerics.dll/temp.s.o "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libc.so" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libm.so"
    [aot-compiler stdout] Stripping the binary: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d obj/Release/aot/armeabi-v7a/libaot-System.Numerics.dll.so.tmp
    [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/Xamarin.AndroidX.AsyncLayoutInflater.dll
    [aot-compiler stdout] AOTID D391A53E-A074-D6C8-91C7-06042548A483
    [aot-compiler stdout] Executing opt: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Annotation.dll/temp.opt.bc" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Annotation.dll/temp.bc"
    [aot-compiler stdout] JIT time: 165 ms, Generation time: 1451 ms, Assembly+Link time: 93 ms.
    [aot-compiler stdout] Executing opt: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AsyncLayoutInflater.dll/temp.opt.bc" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AsyncLayoutInflater.dll/temp.bc"
    [aot-compiler stdout] Executing llc: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/llc"  -enable-implicit-null-checks -disable-fault-maps -mattr=+vfp2,-neon,+d16 -asm-verbose=false -mtriple=armv7-linux-gnueabi -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=mono_aot_Xamarin_AndroidX_Annotation_eh_frame -disable-tail-calls -relocation-model=pic -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Annotation.dll/temp-llvm.s" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Annotation.dll/temp.opt.bc"
    [aot-compiler stdout] Compiled: 9/9
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Annotation.dll/temp.s.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Annotation.dll/temp.s
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Annotation.dll/temp-llvm.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Annotation.dll/temp-llvm.s
    [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/Xamarin.AndroidX.Arch.Core.Common.dll
    [aot-compiler stdout] AOTID 9CCDD130-1F3D-9BBE-FB2E-926FFEE0CA9B
    [aot-compiler stdout] Executing opt: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Arch.Core.Common.dll/temp.opt.bc" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Arch.Core.Common.dll/temp.bc"
    [aot-compiler stdout] Executing the native linker: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld" -Bsymbolic -shared -o obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.Annotation.dll.so.tmp "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Annotation.dll/temp-llvm.o" obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Annotation.dll/temp.s.o "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libc.so" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libm.so"
    [aot-compiler stdout] Executing llc: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/llc"  -enable-implicit-null-checks -disable-fault-maps -mattr=+vfp2,-neon,+d16 -asm-verbose=false -mtriple=armv7-linux-gnueabi -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=mono_aot_Xamarin_AndroidX_AsyncLayoutInflater_eh_frame -disable-tail-calls -relocation-model=pic -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AsyncLayoutInflater.dll/temp-llvm.s" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AsyncLayoutInflater.dll/temp.opt.bc"
    [aot-compiler stdout] Stripping the binary: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.Annotation.dll.so.tmp
    [aot-compiler stdout] JIT time: 13 ms, Generation time: 163 ms, Assembly+Link time: 72 ms.
    [aot-compiler stdout] Executing llc: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/llc"  -enable-implicit-null-checks -disable-fault-maps -mattr=+vfp2,-neon,+d16 -asm-verbose=false -mtriple=armv7-linux-gnueabi -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=mono_aot_Xamarin_AndroidX_Arch_Core_Common_eh_frame -disable-tail-calls -relocation-model=pic -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Arch.Core.Common.dll/temp-llvm.s" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Arch.Core.Common.dll/temp.opt.bc"
    [aot-compiler stdout] Compiled: 9/9
    [aot-compiler stdout] Compiled: 9/9
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AsyncLayoutInflater.dll/temp.s.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AsyncLayoutInflater.dll/temp.s
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Arch.Core.Common.dll/temp.s.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Arch.Core.Common.dll/temp.s
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Arch.Core.Common.dll/temp-llvm.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Arch.Core.Common.dll/temp-llvm.s
    [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/Xamarin.AndroidX.Browser.dll
    [aot-compiler stdout] AOTID F6725264-89C8-C16F-48D7-297AFDA4DC62
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AsyncLayoutInflater.dll/temp-llvm.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AsyncLayoutInflater.dll/temp-llvm.s
    [aot-compiler stdout] Executing opt: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Browser.dll/temp.opt.bc" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Browser.dll/temp.bc"
    [aot-compiler stdout] Executing the native linker: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld" -Bsymbolic -shared -o obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.Arch.Core.Common.dll.so.tmp "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Arch.Core.Common.dll/temp-llvm.o" obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Arch.Core.Common.dll/temp.s.o "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libc.so" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libm.so"
    [aot-compiler stdout] Stripping the binary: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.Arch.Core.Common.dll.so.tmp
    [aot-compiler stdout] JIT time: 5 ms, Generation time: 106 ms, Assembly+Link time: 71 ms.
    [aot-compiler stdout] Executing the native linker: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld" -Bsymbolic -shared -o obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.AsyncLayoutInflater.dll.so.tmp "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AsyncLayoutInflater.dll/temp-llvm.o" obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AsyncLayoutInflater.dll/temp.s.o "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libc.so" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libm.so"
    [aot-compiler stdout] Stripping the binary: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.AsyncLayoutInflater.dll.so.tmp
    [aot-compiler stdout] JIT time: 35 ms, Generation time: 89 ms, Assembly+Link time: 67 ms.
    [aot-compiler stdout] Executing llc: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/llc"  -enable-implicit-null-checks -disable-fault-maps -mattr=+vfp2,-neon,+d16 -asm-verbose=false -mtriple=armv7-linux-gnueabi -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=mono_aot_Xamarin_AndroidX_Browser_eh_frame -disable-tail-calls -relocation-model=pic -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Browser.dll/temp-llvm.s" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Browser.dll/temp.opt.bc"
    [aot-compiler stdout] Compiled: 15/15
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Browser.dll/temp.s.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Browser.dll/temp.s
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Browser.dll/temp-llvm.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Browser.dll/temp-llvm.s
    [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/XamarinLlvmIssue.dll
    [aot-compiler stdout] AOTID 64FD0AFC-CAAE-B651-4322-44F29FD98F4D
    [aot-compiler stdout] Executing opt: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "obj/Release/aot/armeabi-v7a/XamarinLlvmIssue.dll/temp.opt.bc" "obj/Release/aot/armeabi-v7a/XamarinLlvmIssue.dll/temp.bc"
    [aot-compiler stdout] Executing llc: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/llc"  -enable-implicit-null-checks -disable-fault-maps -mattr=+vfp2,-neon,+d16 -asm-verbose=false -mtriple=armv7-linux-gnueabi -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=mono_aot_XamarinLlvmIssue_eh_frame -disable-tail-calls -relocation-model=pic -o "obj/Release/aot/armeabi-v7a/XamarinLlvmIssue.dll/temp-llvm.s" "obj/Release/aot/armeabi-v7a/XamarinLlvmIssue.dll/temp.opt.bc"
    [aot-compiler stdout] Executing the native linker: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld" -Bsymbolic -shared -o obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.Browser.dll.so.tmp "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Browser.dll/temp-llvm.o" obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Browser.dll/temp.s.o "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libc.so" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libm.so"
    [aot-compiler stdout] Compiled: 43/43
    [aot-compiler stdout] Stripping the binary: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.Browser.dll.so.tmp
    [aot-compiler stdout] JIT time: 9 ms, Generation time: 350 ms, Assembly+Link time: 70 ms.
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/XamarinLlvmIssue.dll/temp.s.o obj/Release/aot/armeabi-v7a/XamarinLlvmIssue.dll/temp.s
    [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/Xamarin.AndroidX.Activity.dll
    [aot-compiler stdout] AOTID F1649985-CA8E-FA4D-2678-DEE74A69AEE5
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/XamarinLlvmIssue.dll/temp-llvm.o obj/Release/aot/armeabi-v7a/XamarinLlvmIssue.dll/temp-llvm.s
    [aot-compiler stdout] Executing opt: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Activity.dll/temp.opt.bc" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Activity.dll/temp.bc"
    [aot-compiler stdout] Executing the native linker: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld" -Bsymbolic -shared -o obj/Release/aot/armeabi-v7a/libaot-XamarinLlvmIssue.dll.so.tmp "obj/Release/aot/armeabi-v7a/XamarinLlvmIssue.dll/temp-llvm.o" obj/Release/aot/armeabi-v7a/XamarinLlvmIssue.dll/temp.s.o "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libc.so" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libm.so"
    [aot-compiler stdout] Stripping the binary: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d obj/Release/aot/armeabi-v7a/libaot-XamarinLlvmIssue.dll.so.tmp
    [aot-compiler stdout] Executing llc: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/llc"  -enable-implicit-null-checks -disable-fault-maps -mattr=+vfp2,-neon,+d16 -asm-verbose=false -mtriple=armv7-linux-gnueabi -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=mono_aot_Xamarin_AndroidX_Activity_eh_frame -disable-tail-calls -relocation-model=pic -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Activity.dll/temp-llvm.s" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Activity.dll/temp.opt.bc"
    [aot-compiler stdout] JIT time: 17 ms, Generation time: 867 ms, Assembly+Link time: 74 ms.
    [aot-compiler stdout] Compiled: 15/15
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Activity.dll/temp.s.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Activity.dll/temp.s
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Activity.dll/temp-llvm.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Activity.dll/temp-llvm.s
    [aot-compiler stdout] Executing the native linker: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld" -Bsymbolic -shared -o obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.Activity.dll.so.tmp "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Activity.dll/temp-llvm.o" obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.Activity.dll/temp.s.o "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libc.so" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libm.so"
    [aot-compiler stdout] Stripping the binary: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.Activity.dll.so.tmp
    [aot-compiler stdout] JIT time: 6 ms, Generation time: 268 ms, Assembly+Link time: 67 ms.
    [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/Xamarin.AndroidX.AppCompat.AppCompatResources.dll
    [aot-compiler stdout] AOTID 2DF674B0-A4A6-0EA4-8846-1D816548A1E9
    [aot-compiler stdout] Executing opt: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AppCompat.AppCompatResources.dll/temp.opt.bc" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AppCompat.AppCompatResources.dll/temp.bc"
    [aot-compiler stdout] Executing llc: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/llc"  -enable-implicit-null-checks -disable-fault-maps -mattr=+vfp2,-neon,+d16 -asm-verbose=false -mtriple=armv7-linux-gnueabi -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=mono_aot_Xamarin_AndroidX_AppCompat_AppCompatResources_eh_frame -disable-tail-calls -relocation-model=pic -o "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AppCompat.AppCompatResources.dll/temp-llvm.s" "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AppCompat.AppCompatResources.dll/temp.opt.bc"
    [aot-compiler stdout] Compiled: 11/11
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AppCompat.AppCompatResources.dll/temp.s.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AppCompat.AppCompatResources.dll/temp.s
    [aot-compiler stdout] Executing the native assembler: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as"   -mfpu=vfp3 -o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AppCompat.AppCompatResources.dll/temp-llvm.o obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AppCompat.AppCompatResources.dll/temp-llvm.s
    [aot-compiler stdout] Executing the native linker: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld" -Bsymbolic -shared -o obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.AppCompat.AppCompatResources.dll.so.tmp "obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AppCompat.AppCompatResources.dll/temp-llvm.o" obj/Release/aot/armeabi-v7a/Xamarin.AndroidX.AppCompat.AppCompatResources.dll/temp.s.o "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libc.so" "/usr/local/share/android-ndk/platforms/android-21/arch-arm/usr/lib/libm.so"
    [aot-compiler stdout] Stripping the binary: "/usr/local/share/android-ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d obj/Release/aot/armeabi-v7a/libaot-Xamarin.AndroidX.AppCompat.AppCompatResources.dll.so.tmp
    [aot-compiler stdout] JIT time: 5 ms, Generation time: 241 ms, Assembly+Link time: 66 ms.
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1934,3): error XA3001: Could not AOT the assembly: Square.OkHttp3.dll
Done building target "_BuildApkEmbed" in project "XamarinLlvmIssue.csproj" -- FAILED.

Done building project "XamarinLlvmIssue.csproj" -- FAILED.

Build FAILED.

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1934,3): error XA3001: Could not AOT the assembly: Square.OkHttp3.dll
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:05.16

Package creation failed

VS bug #1339828

@lassana lassana added Area: App+Library Build Issues when building Library projects or Application projects. needs-triage Issues that need to be assigned. labels Mar 22, 2021
@jonathanpeppers jonathanpeppers added Area: Mono runtime or AOT Compiler and removed needs-triage Issues that need to be assigned. labels Apr 23, 2021
@georgeemr
Copy link

This is happening randomly after updating Visual Studio to 16.10.0.
I get XA3001: Could not AOT the assembly: Xamarin.AndroidX.Lifecycle.ViewModel.dll
And after trying again: XA3001: Could not AOT the assembly: Java.Interop.dll
and each time the library change.

@inforithmics
Copy link

inforithmics commented May 27, 2021

I have the same problem with Visual Studio 16.10.0.
for me it is Java.Interop.dll error XA3001: Could not AOT the assembly: Java.Interop.dll

@inforithmics
Copy link

inforithmics commented May 27, 2021

In the Build output I found following message

[aot-compiler stderr] obj\Release\110\aot\armeabi-v7a\Java.Interop.dll\temp-llvm.s: Assembler messages:
[aot-compiler stderr] obj\Release\110\aot\armeabi-v7a\Java.Interop.dll\temp-llvm.s:667: Rd and Rm should be different in mla
For me it seems that Android specific Assemblies can't be AOT Compiled, because the IOS Build works with AOT.

the Android Target that doesn't work is armeabi-v7a
and iOS has the Target arm64 (Because iOS has only arm64 as target).

Additional Information: 31.5.2021
It seems to be really a path problem on Windows.

@inforithmics
Copy link

I found following Issue for the Android NDK 19

android/ndk#906

So it seems the Code is not correctly Targeted for armeabi-v7a. Meaning it generates Assembly Code that is not allowed for this specific Target.

@inforithmics
Copy link

For me the workaround works too (Disabling LLVM AOT Compilation). So it seems there is a Bug in the LLVM armeabi-v7a Code Compilation

@inforithmics
Copy link

inforithmics commented May 29, 2021

Because disabling LLVM makes the app much slower I reverted to Visual Studio 2019 16.9.6 and it works now again. So it seems to be a regression.

Here the link to download older Visual Studio 2019 Versions:

https://docs.microsoft.com/en-us/visualstudio/releases/2019/history

@inforithmics
Copy link

inforithmics commented May 31, 2021

I think I found the problem.

Following output is generated during compilation

2021-05-28T22:15:09.3191452Z   [aot-compiler stdout] Executing the native linker: "C:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE" -Bsymbolic -shared -o obj\Release\110\aot\armeabi-v7a\libaot-Xamarin.AndroidX.CardView.dll.so.tmp "obj\Release\110\aot\armeabi-v7a\Xamarin.AndroidX.CardView.dll\temp-llvm.o" obj\Release\110\aot\armeabi-v7a\Xamarin.AndroidX.CardView.dll\temp.s.o -LC:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x -LC:\Program Files (x86)\Android\android-sdk\ndk-bundle\platforms\android-21\arch-arm\usr\lib -LC:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\..\sysroot\usr\lib\arm-linux-androideabi "C:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x\libgcc.a" "C:\Program Files (x86)\Android\android-sdk\ndk-bundle\platforms\android-21\arch-arm\usr\lib\libc.so" "C:\Program Files (x86)\Android\android-sdk\ndk-bundle\platforms\android-21\arch-arm\usr\lib\libm.so"
2021-05-28T22:15:09.3195848Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
2021-05-28T22:15:09.3197593Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x: No such file or directory
2021-05-28T22:15:09.3199375Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
2021-05-28T22:15:09.3200935Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk\ndk-bundle\platforms\android-21\arch-arm\usr\lib: No such file or directory
2021-05-28T22:15:09.3202549Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
2021-05-28T22:15:09.3204244Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\..\sysroot\usr\lib\arm-linux-androideabi: No such file or directory
2021-05-28T22:15:09.3205865Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -lunwind
2021-05-28T22:15:09.3207138Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -lcompiler_rt-extras
2021-05-28T22:15:09.3208785Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -lgcc_real
2021-05-28T22:15:09.3210086Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -ldl

Here it says "cannot open (x86)\Android" and this is not a valid folder this happens when on windows the path with spaces is not quoted by "

And the llc call has following line
-LC:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x
Where the double quotes are missing.

It should be
-L"C:\Program Files (x86)\Android\android-sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x"

The workaround is to Install the Android SDK into a path where there are no empty spaces

For example

C:\Users\**username**\AppData\Local\Android\sdk

This is the default Sdk Path of the Android Sdk username is the current logged in username
Changing the sdk and llvm works again.

The Android Studio has following opinion on this folder.

image

@lassana
Copy link
Author

lassana commented May 31, 2021

@inforithmics I don't think this is the issue. In my case both SDK and NDK paths do not have spaces:

Android NDK: /usr/local/share/android-ndk/
Android SDK: /usr/local/share/android-sdk/

@inforithmics
Copy link

inforithmics commented May 31, 2021

I think the AOT Bug I experienced got introduced on Windows with Visual Studio 19.10. and doesen't seem to be related to your - The same message but different reasons.
I installed Android Studio and used the Android sdk provided by Android Studio and then it worked. Maybe the Android Sdk provided by Xamarin Android has some missing updates.

@usausa
Copy link

usausa commented May 31, 2021

After installing 16.10.0, I also got a problem with XA3001.

@charlesroddie
Copy link

charlesroddie commented May 31, 2021

Getting this in Azure Pipelines which started failing on Friday on builds using VS16.10.0 (introduced in image 20210525.0).

it seems there is a Bug in the LLVM armeabi-v7a Code Compilation

Tried removing all references to 32 bit android in <AndroidSupportedAbis> but it didn't make a difference.

@inforithmics
Copy link

inforithmics commented May 31, 2021

Changing the Android Sdk Location. to the Android Studio Sdk

image

Then running Android Sdk Manager (for installing missing packages). Fixed the Compilation Problems for me.

@johnthiriet
Copy link

johnthiriet commented May 31, 2021

Getting this in Azure Pipelines which started failing on Friday on builds using VS16.10.0 (introduced in image 20210525.0).

it seems there is a Bug in the LLVM armeabi-v7a Code Compilation

Tried removing all references to 32 bit android in <AndroidSupportedAbis> but it didn't make a difference.

I can confirm the same issue on Azure Pipelines. It started on Friday for us. It's completely random.

** EDIT **

Actually it's failing almost 9 times out of 10 now. Pretty annoying.

@charlesroddie
Copy link

Actually it's failing almost 9 times out of 10 now.

They are updating servers so it's random which image you get! Was causing us to become very confused about what changes were fixing or breaking things.

@inforithmics
Copy link

@lassana I tried your reproduction sample and it failed for me too (on Visual Studio for Mac). After I updated Square.OkHttp3 to the newest version - llvm worked. It could be that only newer versions of Square.OkHttp3 works with llvm.

@lassana
Copy link
Author

lassana commented May 31, 2021

@inforithmics thanks for the info. I'll see if we can upgrade to 3.12.6 (the last version that supports Android 4.4).

@johnthiriet
Copy link

The problem is not specific to a particular library.
It happens to us with System.Numerics for example.

@AndreyBespamyatnov
Copy link

We have the same issue.

Look the issue with path as well:

2021-05-31T21:49:31.2414613Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk\21.4.7075529\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
2021-05-31T21:49:31.2416389Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk\21.4.7075529\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk\ndk\21.4.7075529\toolchains\llvm\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x: No such file or directory
2021-05-31T21:49:31.2417574Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk\21.4.7075529\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
2021-05-31T21:49:31.2419262Z   [aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk\ndk\21.4.7075529\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk\ndk\21.4.7075529\platforms\android-21\arch-arm\usr\lib: No such file or directory

@alexvitoriano
Copy link

The problem is not specific to a particular library.
It happens to us with System.Numerics for example.

This error is quite generic because it could happen with any lib, I've had the same problem and sometimes just build again and it goes fine, for some builds got stuck forever...
I'm using Azure pipeline for the builds

@SKeehnen
Copy link

SKeehnen commented Jun 1, 2021

Changing the Android Sdk Location. to the Android Studio Sdk

image

Then running Android Sdk Manager (for installing missing packages). Fixed the Compilation Problems for me.

I changed it to a path name without a space and that was the solution. Thanks!

@jonpryor jonpryor added the vs-sync For internal use only; creates a VSTS "mirror" issue. label Jun 1, 2021
@jonpryor
Copy link
Member

jonpryor commented Jun 2, 2021

There are two related yet different issues here:

  1. Path Quoting.
  2. Linker Invocation Errors.

"Path quoting" is what most of the comments on this issue are about, e.g. @inforithmics comment. Path quoting is being tracked at Issue #5964.

The "Linker Invocation Errors" were (buried) in the original Log File > Archive Output:

    [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/Square.OkHttp3.dll
    [aot-compiler stdout] AOTID C3AD85CB-5B6D-9D3B-A3FD-95FF961A4FA9
    [aot-compiler stdout] Executing opt: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "obj/Release/aot/armeabi-v7a/Square.OkHttp3.dll/temp.opt.bc" "obj/Release/aot/armeabi-v7a/Square.OkHttp3.dll/temp.bc"
    [aot-compiler stderr] Basic Block in function 'Square_OkHttp3_Address__ctor_string_int_Square_OkHttp3_IDns_Javax_Net_SocketFactory_Javax_Net_Ssl_SSLSocketFactory_Javax_Net_Ssl_IHostnameVerifier_Square_OkHttp3_CertificatePinner_Square_OkHttp3_IAuthenticator_Java_Net_Proxy_System_Collections_Generic_IList_1_Square_OkHttp3_Protocol_System_Collections_Generic_IList_1_Square_OkHttp3_ConnectionSpec_Java_Net_ProxySelector' does not have terminator!
    [aot-compiler stderr] label %NOTINITED_BB35
    [aot-compiler stderr] LLVM ERROR: Broken module found, compilation aborted!
    [aot-compiler stderr] AOT of image /Users/user/Desktop/XamarinLlvmIssue/obj/Release/android/assets/shrunk/Square.OkHttp3.dll failed.
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1934,3): error XA3001: Could not AOT the assembly: Square.OkHttp3.dll

Here we see that opt … obj/Release/aot/armeabi-v7a/Square.OkHttp3.dll/temp.bc failed with multiple errors, resulting in LLVM ERROR: Broken module found, compilation aborted!. This error appears to be coming from opt (an LLVM tool).

I'm believe that this LLVM error is unrelated to the path quoting issue, largely because the path quoting issue is predominantly on Windows (as paths with spaces, while possible, are rarer on macOS). (It's also possible that it's just a "one-off" error, and on rebuild it wouldn't recur.)

@jonpryor
Copy link
Member

jonpryor commented Jun 2, 2021

@vargaz: do you have any insights into the opt error reported above?

@vargaz
Copy link
Contributor

vargaz commented Jun 4, 2021

The failing assembly contains invalid IL, in Square.OkHttp3.dll, in the
Address::.ctor method:

      IL_0182:  ldloc.3
      IL_0183:  call       void [Mono.Android]Android.Runtime.JNIEnv::FinishCreateInstance(native int,
                                                                                           string,
                                                                                           [Mono.Android]Android.Runtime.JValue*)
      IL_0188:  leave.s    IL_014d

      IL_018a:  ldsfld     native int Square.OkHttp3.Address::id_ctor_Ljava_lang_String_ILokhttp3_Dns_Ljavax_net_SocketFactory_Ljavax_net_ssl_SSLSocketFactory_Ljavax_net_ssl_HostnameVerifier_Lokhttp3_CertificatePinner_Lokhttp3_Authenticator_Ljava_net_Proxy_Ljava_util_List_Ljava_util_List_Ljava_net_ProxySelector_
      IL_018f:  ldsfld     native int [mscorlib]System.IntPtr::Zero
      IL_0194:  call       bool [mscorlib]System.IntPtr::op_Equality(native int,
                                                                     native int)

There is a leave instruction in the middle of the try block, the instruction should be the last instruction in a try block, also
it jumps back to the invalid IL offset IL_014d.

@jonpryor
Copy link
Member

jonpryor commented Jun 4, 2021

@vargaz wrote:

The failing assembly contains invalid IL

Do you have any idea where the invalid IL is coming from? Does the NuGet package contain invalid IL, suggesting a C# compiler issue? Or is this a linker-related bug?

@jonathanpeppers
Copy link
Member

Since this is a binding project, could this be related to: e88cfbc

@johnthiriet
Copy link

johnthiriet commented Jun 4, 2021

Hi everyone. I just want to restate that it happens on any librairies in windows Microsoft hosted agents ie:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1961,3): error XA3001: Could not AOT the assembly: System.dll [D:\a\1\s\Sources\MyProject.Android\MyProject.Android.csproj]

@jonpryor
Copy link
Member

jonpryor commented Jun 4, 2021

@johnthiriet : the issue you're hitting is Issue #5964.

@jonpryor
Copy link
Member

jonpryor commented Jun 7, 2021

@jonathanpeppers wrote:

Since this is a binding project, could this be related to: e88cfbc

This isn't a binding project, it's an app project, but the point remains: could GC.KeepAlive() insertions -- controlled by added in commit e88cfbc and controlled by the $(AndroidAddKeepAlives) property -- be responsible for the crash?

Answer: Yes.

% rm -Rf bin obj
% msbuild /restore /bl /p:AndroidAddKeepAlives=False /p:Configuration=Release /t:SignAndroidPackage
# no errors

Additionally, obj/Release/android/assets/Square.OkHttp3.dll does not contain the invalid IL that @vargaz reported:

      IL_0182:  ldloc.3
      IL_0183:  call       void [Mono.Android]Android.Runtime.JNIEnv::FinishCreateInstance(native int,
                                                                                           string,
                                                                                           [Mono.Android]Android.Runtime.JValue*)
      IL_0188:  leave.s    IL_01f6

      IL_018a:  ldsfld     native int Square.OkHttp3.Address::id_ctor_Ljava_lang_String_ILokhttp3_Dns_Ljavax_net_SocketFactory_Ljavax_net_ssl_SSLSocketFactory_Ljavax_net_ssl_HostnameVerifier_Lokhttp3_CertificatePinner_Lokhttp3_Authenticator_Ljava_net_Proxy_Ljava_util_List_Ljava_util_List_Ljava_net_ProxySelector_
      IL_018f:  ldsfld     native int [mscorlib]System.IntPtr::Zero

Note that the leave.s instruction targets a future address/label, IL_01f6, whereas the "invalid IL" version had a backwards address/label of IL_014d.

@jonpryor
Copy link
Member

jonpryor commented Jun 7, 2021

@lassana: as a workaround, please update your .csproj to contain:

  <PropertyGroup>
    <AndroidAddKeepAlives>False</AndroidAddKeepAlives>
  </PropertyGroup>

See also: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/building-apps/build-properties#androidaddkeepalives

@jonpryor jonpryor changed the title Error XA3001: Could not AOT the assembly: Square.OkHttp3.dll (XA3001) $(AndroidAddKeepAlives)=True results in XA3001 error with Square.OkHttp3.dll Jun 7, 2021
@queequac
Copy link

queequac commented Jun 10, 2021

I have a similar issue, but neither adding AndroidAddKeepAlives nor changing the path into something not containing spaces helps.

I keep getting the following since for AOT+LLVM since updating to VS 16.10:

[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory

I am wondering about the line break after the configured path for the SDK (here C:\Program Files (x86)\Android\android-sdk) and that the next line obviously misses one character. Or is that just some formatting issue of the build output?

Of course there lots of further [aot-compiler stderr] errors and this finally ends in XA3001: Could not AOT the assembly: CommonServiceLocator.dll

@dellis1972
Copy link
Contributor

@queequac the issue you're hitting is Issue #5964.

@Tommigun1980
Copy link

@lassana: as a workaround, please update your .csproj to contain:

  <PropertyGroup>
    <AndroidAddKeepAlives>False</AndroidAddKeepAlives>
  </PropertyGroup>

See also: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/building-apps/build-properties#androidaddkeepalives

I want to confirm that this workaround worked for me. I couldn't enable LLVM due to it complaining about some IL errors in the 'Google.ZXing.Core' library, but after adding the above workaround my project compiled fine. My report about this problem is at xamarin/XamarinComponents#1193 in case it is relevant for your investigations.

@Tommigun1980
Copy link

@jonpryor When will this issue be fixed? Is there a pull request pending or when can we expect being able to remove the AndroidAddKeepAlives hack?

Thank you.

@nodoid
Copy link

nodoid commented Jul 26, 2021

I'm getting this error with Xam.Forms.Platforn.Android, so it's possible the issue isn't llvm

@jpobst
Copy link
Contributor

jpobst commented May 15, 2024

With support for Classic Xamarin.Android ended May 1st, 2024, this issue is likely no longer relevant.

If this still persists in .NET 8+, please open a new issue with updated information based on net8.0-android or greater. Please include a link to this issue for context.

@jpobst jpobst closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App+Library Build Issues when building Library projects or Application projects. Area: Mono Runtime Mono-related issues: BCL bugs, AOT issues, etc. vs-sync For internal use only; creates a VSTS "mirror" issue.
Projects
None yet
Development

No branches or pull requests