Bug 56098 - Native library 'XXX' was referenced but could not be found.
Summary: Native library 'XXX' was referenced but could not be found.
Status: RESOLVED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: mmp ()
Version: 3.4.0 (15.2)
Hardware: Macintosh Mac OS
: High normal
Target Milestone: 15.3
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2017-05-08 14:04 UTC by Matthew Leibowitz
Modified: 2017-08-01 14:23 UTC (History)
3 users (show)

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


Attachments
Test Case (5.34 MB, application/zip)
2017-05-08 14:04 UTC, Matthew Leibowitz
Details


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 Matthew Leibowitz 2017-05-08 14:04:22 UTC
Created attachment 22003 [details]
Test Case

I created (and attached) a sample app that has 2 projetcs:
 - an app with native references to 2 .dylib
 - a class library that P/Invokes those .dylib

The app works in Debug configuration, so the libraries are fine and so is the code. When I switch to Release configuration the FIRST build fails:

    MSBUILD : warning : Cannot expand $(AppIdentifierPrefix) in Entitlements.plist without a provisioning profile.
    MMP : warning MM2006: Native library 'libSkiaSharp.dylib' was referenced but could not be found.
    MMP : warning MM2009: Referenced by MacClassLibrary.MyClass.sk_colortype_get_default_8888
    MMP : warning MM2006: Native library 'libHarfBuzzSharp.dylib' was referenced but could not be found.
    MMP : warning MM2009: Referenced by MacClassLibrary.MyClass.hb_buffer_create
    MMP : warning MM2009: Referenced by MacClassLibrary.MyClass.hb_buffer_destroy
    bin/Release/NativeReferencesTest.app/Contents/MonoBundle/libMonoPosixHelper.dylib : error : /Users/matthew/Projects/Testing/NativeReferencesTest/NativeReferencesTest/bin/Release/NativeReferencesTest.app/Contents/MonoBundle/libMonoPosixHelper.dylib: No such file or directory
    bin/Release/NativeReferencesTest.app/Contents/MonoBundle/libHarfBuzzSharp.dylib : error : /Users/matthew/Projects/Testing/NativeReferencesTest/NativeReferencesTest/bin/Release/NativeReferencesTest.app/Contents/MonoBundle/libHarfBuzzSharp.dylib: replacing existing signature
    bin/Release/NativeReferencesTest.app/Contents/MonoBundle/libHarfBuzzSharp.dylib : error : /Users/matthew/Projects/Testing/NativeReferencesTest/NativeReferencesTest/bin/Release/NativeReferencesTest.app/Contents/MonoBundle/libHarfBuzzSharp.dylib: No such file or directory
   
Full Log:
https://gist.github.com/mattleibow/396f1a8bfb573d2694b2e4bd196da050

The subsequent builds do succeed.
Comment 1 Chris Hamons 2017-05-08 14:18:31 UTC
Looks like something is wrong with the msbuild?

We only get this to mmp:

		  NativeReferences:
		    /Users/donblas/Downloads/NativeReferencesTest/NativeFiles/libSkiaSharp.dylib

But this later in signing:

		  Resources:
		    bin/Release/NativeReferencesTest.app/Contents/MonoBundle/libHarfBuzzSharp.dylib
		  bin/Release/NativeReferencesTest.app/Contents/MonoBundle/libMonoPosixHelper.dylib
		    bin/Release/NativeReferencesTest.app/Contents/MonoBundle/libHarfBuzzSharp.dylib
		  bin/Release/NativeReferencesTest.app/Contents/MonoBundle/libMonoPosixHelper.dylib
		    bin/Release/NativeReferencesTest.app/Contents/MonoBundle/libSkiaSharp.dylib
Comment 2 Chris Hamons 2017-05-08 14:28:32 UTC
Something is rather wrong...

	Task "Mmp"
		Using task Mmp from Xamarin.Mac.Tasks.Mmp, Xamarin.Mac.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
	Done executing task "Mmp"
	Task "Mmp"
		Using task Mmp from Xamarin.Mac.Tasks.Mmp, Xamarin.Mac.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Comment 3 Chris Hamons 2017-05-08 18:03:25 UTC
https://github.com/xamarin/xamarin-macios/pull/2073
Comment 4 Sebastien Pouliot 2017-08-01 03:12:06 UTC
> chamons merged commit 30cf1fd into master  on May 16

Please check which version has the fix, update the fields and close. Thanks!
Comment 5 Chris Hamons 2017-08-01 14:23:54 UTC
 git branch --contains  30cf1fd  --all

  remotes/origin/d15-3
  remotes/origin/xcode9

So, it's d15-3 first.