Bug 3477 - destination of symlinks is used for native libraries
Summary: destination of symlinks is used for native libraries
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-02-15 14:33 UTC by Chris Toshok
Modified: 2012-10-18 15:01 UTC (History)
3 users (show)

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

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:
Status:
RESOLVED FIXED

Description Chris Toshok 2012-02-15 14:33:33 UTC
1. create a .so for android
2. add a "lib/armeabi" folder to your project
3. "Add File" the .so to this folder, but choose Link, not Copy.
4. try to deploy to device

you'll get an error which looks like:

"Could not determine abi of native library ../../../mono-heapdump/libpoker.so"

the problem is that whatever build machinery is involved (xbuild, presumably) is trying to determine the abi after resolving the symlink, instead of using the project folder structure.  presumably it would work if the target of the symlink was ../../../mono-heapdump/armeabi/libpoker.so
Comment 1 Atsushi Eno 2012-10-18 15:01:43 UTC
Thanks, you're right, resolving ABI based on the real path would make little sense.

I fixed this issue as: for each <AndroidNativeLibrary> item in csproj, we first check Abi metadata and use it if any, then we check Link metadata which usually represents the "virtual" path in the project folder structure (i.e. if the file is under libs/armeabi/ it will be "libs/armeabi/possibly_symlinked_file.so"), and then look at default (ItemSpec) path if it still couldn't determine the ABI.

I hope the Link metadata would mostly detect the ABI as expected.

The fix should be included in the next-to-next public version.

[master 13b6558]