Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
The new support for referencing native frameworks is nearly usable!
However, a native framework may have any sort of arbitrary ID. For example, the official ChromiumEmbeddedFramework.framework has an ID of @executable_path/ChromiumEmbeddedFramework.
Assuming that on disk the "source" ChromiumEmbeddedFramework binary is at:
And if we run `otool -L` against it we can see its ID is (first line of the output):
When mmp links the framework into the main app executable, it does this:
clang -F path/to/ChromiumEmbeddedFrameworkParentDir -framework ChromiumEmbeddedFramework
Which results in the native app executable referencing the framework at:
HOWEVER, the framework is copied into the app bundle into Contents/Frameworks/ChromiumEmbeddedFramework.framework, so the above path is invalid and will result in a native crash upon startup.
I believe the steps mmp should take are:
1. copy the framework into the app bundle (currently behaving correctly)
2. adjust the ID of the copied framework binary:
install_name_tool -id '@loader_path/../Frameworks/ChromiumEmbeddedFramework.framework/ChromiumEmbeddedFramework' 'bin/Debug/MyApp.app/Contents/Frameworks/ChromiumEmbeddedFramework.framework/ChromiumEmbeddedFramework'
3. link with clang:
clang -F bin/Debug/MyApp.app/Contents/Frameworks -framework ChromiumEmbeddedFramework
Note that we add step (2) and modify the framework binary that has already been copied into the bundle by step (1). You do not want to modify the framework as specified as the native reference (the "source" framework).
Step (3) is adjusted to link against the copied and ID-remapped binary, and not the "source" framework.
In talking to Aaron, this is a nice to have but not requires for C7 to go out. Since we're close to freeze, punting for now.
I believe this is fixed in https://github.com/xamarin/xamarin-macios/commit/08ba6a7af71acedbf7e713e85d2789ebc64759eb