Bug 54988 - Build can't figure out the type of an armeabi binary built by Android Studio
Summary: Build can't figure out the type of an armeabi binary built by Android Studio
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 7.2 (15.1)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: dean.ellis
Depends on:
Reported: 2017-04-10 21:46 UTC by James Moore
Modified: 2017-04-18 15:58 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

tarball of the file that fails to build (84.19 KB, application/x-gzip)
2017-04-10 21:46 UTC, James Moore

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description James Moore 2017-04-10 21:46:49 UTC
Created attachment 21410 [details]
tarball of the file that fails to build

Try to build the project (tarball attached to the bug report) by doing "msbuild  /t:PackageForAndroid" from a command line.  You'll get a bunch of errors, the important one (or at least I assume it's the important one):

  /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets : error : Cannot determine abi of native library libjameslib.so. [/Users/james/Projects/SampleHolder/SampleHolder/SampleHolder.csproj]

The .so was built by android studio and is an arm binary:

./SampleHolder/libjameslib.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=939c935f6346f2c00fe707d99a00cc544c7ad5a8, stripped
Comment 1 James Moore 2017-04-10 21:47:11 UTC
=== Xamarin Studio Professional ===

Version 6.3 (build 863)
Installation UUID: 6dc077b1-7f04-4c1c-b481-1dcbb9a8b0a1
	Mono (2017-02/dda961c) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500000042

=== NuGet ===


=== Xamarin.Profiler ===

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

=== Apple Developer Tools ===

Xcode 8.3.1 (12170)
Build 8E1000a

=== Xamarin.iOS ===

Version: (Visual Studio Professional)
Hash: fe490c24
Branch: d15-2
Build date: 2017-04-04 16:48:23-0400

=== Xamarin.Android ===

Version: (Visual Studio Professional)
Android SDK: /Users/james/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		5.0 (API level 21)
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 26.0.1
SDK Platform Tools Version: 25.0.4
SDK Build Tools Version: 25.0.2

Java SDK: /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

Android Designer EPL code available here:

=== Xamarin.Mac ===

Version: (Visual Studio Professional)

=== Xamarin Inspector ===

Version: 1.2.1
Hash: 0ea0a12
Branch: d15-1
Build date: Thu, 06 Apr 2017 20:24:44 GMT

=== Build Information ===

Release ID: 603000863
Git revision: a2163670efe259c85cd8f335d95b175068fbbe2a
Build date: 2017-04-03 14:33:15-04
Xamarin addins: 2045d688ea1420e0381b473360ca62a763eb7d04
Build lane: monodevelop-lion-d15-1

=== Operating System ===

Mac OS X 10.12.4
Darwin retina.local 16.5.0 Darwin Kernel Version 16.5.0
    Fri Mar  3 16:52:33 PST 2017
    root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
Comment 2 dean.ellis 2017-04-18 15:58:14 UTC
Hi James

You probably need to take a look at the documentation in [1].
We don't do any interrogation of the .so itself, we rely on the folder name its in or the meta data which is attached to it.

So the options are either 

a) put the .so in a armeabi folder.
b) add the metadata to the Item in the csproj like so 

<AndroidNativeLibrary Include="path/to/libfoo.so">

[1] https://developer.xamarin.com/guides/android/under_the_hood/build_process/#AndroidNativeLibrary