android: error XA3001: Could not link native shared library
Steps to Reproduce
- Install Visual Studio for Mac on Mac OS Catalina
- cease Xamarin Forms Mobile project for iOS and Android
- Configure and Run Android project
Expected Behavior
Emulator open and Run the app
Actual Behavior
Could not link native shared library
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2931,3): error XA3001: Could not link native shared library: libxamarin-app.so
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2931,3): error XA3001: Could not link native shared library: libxamarin-app.so
Version Information
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 9
- Comments: 37 (23 by maintainers)
Bookkeeping comment to record version numbers
The new *-as, *-ld, and *-strip binaries themselves are available starting in Xamarin.Android 10.0.0.40, published as part of Visual Studio 2019 for Mac version 8.3 Preview 3.
To work around the issue when using Xamarin.Android 9.4 in Visual Studio 2019 for Mac version 8.2, follow the steps grendello mentioned in the preceding comment to copy the binaries out of the preview version.
The newer preview version Xamarin.Android 10.0.0.43 that was released on Monday as part of Visual Studio 2019 for Mac version 8.3 Preview 5 now also includes the backported commit that “fixes it the Right Way™.” To try the Preview version that includes the complete fix, check for the latest updates on the Preview updater channel in Visual Studio for Mac Preview.
Summary: A new Preview version has now been published that includes a fix for this item. The fix is not yet included in a Release version. I will update this item again when a Release version is available that includes the fix.
Fix included in Xamarin.Android 10.0.0.43.
Fix included on macOS in Visual Studio 2019 for Mac version 8.3 Preview 5.
(The fix is not relevant for Windows.)
I’m also running Catalina and i had the same error. As a workaround, I disabled all 32-bits supported ABIs, leaving only x86_64 and arm64-v8a and my app is deploying again on my 64-bits Android devices.
@muhammadhussain16: Are you running the macOS Catalina beta? macOS Catalina does not support running 32-bit binaries, so if you are using an older SDK or NDK, your build may be attempting to use a 32-bit linker, which will fail.
The forthcoming Xamarin.Android 10.0 release (d16-3) includes its own linker, which is 64-bit and should behave properly.
Alternatively, updating your Android SDK
build-toolspackage & NDK may suffice.Release status update
A new Release version has now been published that includes the fix for this item that “fixes it the Right Way™.”
Fix included in Xamarin.Android 10.0.0.43
Fix included on macOS in Visual Studio 2019 for Mac version 8.3. To get the new version that includes the fix, check for the latest updates on the Stable updater channel.
(The fix is not relevant for Windows.)
@saamerm you can just copy the binaries (
*-as,*-ldand*-strip) from Xamarin.Android location to yourbuild-tools/[VERSION]directory, symlinks would work too. This commit fixes it the Right Way™, but it’s only inmasterfor now.Also experiencing a similar issue when attempting to build to device.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2931,3): error XA3001: Could not link native shared library: libxamarin-app.so
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2931,3): error XA3001: Could not link native shared library: libxamarin-app.so 2 Error(s)