-
Notifications
You must be signed in to change notification settings - Fork 531
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
Comments
This is happening randomly after updating Visual Studio to 16.10.0. |
I have the same problem with Visual Studio 16.10.0. |
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: the Android Target that doesn't work is armeabi-v7a Additional Information: 31.5.2021 |
I found following Issue for the Android NDK 19 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. |
For me the workaround works too (Disabling LLVM AOT Compilation). So it seems there is a Bug in the LLVM armeabi-v7a Code Compilation |
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 |
I think I found the problem. Following output is generated during compilation
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 It should be The workaround is to Install the Android SDK into a path where there are no empty spaces For example
This is the default Sdk Path of the Android Sdk username is the current logged in username The Android Studio has following opinion on this folder. |
@inforithmics I don't think this is the issue. In my case both SDK and NDK paths do not have spaces:
|
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. |
After installing 16.10.0, I also got a problem with XA3001. |
Getting this in Azure Pipelines which started failing on Friday on builds using VS16.10.0 (introduced in image 20210525.0).
Tried removing all references to 32 bit android in |
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. |
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. |
@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. |
@inforithmics thanks for the info. I'll see if we can upgrade to 3.12.6 (the last version that supports Android 4.4). |
The problem is not specific to a particular library. |
We have the same issue. Look the issue with path as well:
|
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... |
There are two related yet different issues here:
"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:
Here we see that 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.) |
The failing assembly contains invalid IL, in Square.OkHttp3.dll, in the
There is a leave instruction in the middle of the try block, the instruction should be the last instruction in a try block, also |
Since this is a binding project, could this be related to: e88cfbc |
Hi everyone. I just want to restate that it happens on any librairies in windows Microsoft hosted agents ie:
|
@johnthiriet : the issue you're hitting is Issue #5964. |
This isn't a binding project, it's an app project, but the point remains: could Answer: Yes.
Additionally, 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 |
@lassana: as a workaround, please update your <PropertyGroup>
<AndroidAddKeepAlives>False</AndroidAddKeepAlives>
</PropertyGroup> |
$(AndroidAddKeepAlives)
=True results in XA3001 error with Square.OkHttp3.dll
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:
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 |
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. |
@jonpryor When will this issue be fixed? Is there a pull request pending or when can we expect being able to remove the Thank you. |
I'm getting this error with Xam.Forms.Platforn.Android, so it's possible the issue isn't llvm |
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 |
Steps to Reproduce
It was working correctly until a recent Xamarin update. As a workaround you can set
EnableLLVM
toFalse
.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
Log File
Archive output
The text was updated successfully, but these errors were encountered: