Bug 34895 - Embedded user frameworks in binding projects prevents projects with incremental builds enabled to build
Summary: Embedded user frameworks in binding projects prevents projects with increment...
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: XI 9.0 (iOS9)
Hardware: PC Mac OS
: --- normal
Target Milestone: C6SR1
Assignee: Rolf Bjarne Kvinge [MSFT]
Depends on:
Reported: 2015-10-15 05:40 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2015-10-28 05:55 UTC (History)
3 users (show)

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:

Description Rolf Bjarne Kvinge [MSFT] 2015-10-15 05:40:21 UTC
* Create a new executable (Unified) project.
* Create a new binding project, and reference it from the executable project.
* Add a native framework to the binding project.
* Add some code to the binding project.
* Add code to reference the binding project from the executable project (so that the reference isn't removed completely by the C# compiler).
* Select a device configuration.
* Enable incremental builds for the executable.
* Build.

A build error like this will happen:

> MTOUCH: error MT3001: Could not AOT the assembly '/path/to/binding-assembly.dll'
>  ld: framework not found /path/to/My.framework
>  clang: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-10-15 05:43:44 UTC
Simpler repo:
* Clone https://github.com/rolfbjarne/embedded-frameworks
* Open simpleapp-with-framework/simpleapp-with-framework.sln
* Select a device configuration
* Enable incremental builds
* Build.

Results in:

>		Process exited with code 1, command:
>		/Applications/Xcode71-beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -isysroot /Applications/Xcode71-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk -Qunused-arguments -miphoneos-version-min=8.0 -arch arm64 -shared -read_only_relocs suppress /work/maccore/master/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonosgen-2.0.dylib -install_name @executable_path/libsimple-framework-binding.dll.dylib -DDEBUG  -o /Users/rolf/Projects/embedded-frameworks/simpleapp-with-framework/simpleapp-with-framework/obj/iPhone/Debug/mtouch-cache/simple-framework-binding.dll.arm64.dylib -framework Foundation -framework UIKit -framework CoreGraphics -framework CFNetwork -framework /Users/rolf/Projects/embedded-frameworks/simpleapp-with-framework/simpleapp-with-framework/obj/iPhone/Debug/mtouch-cache/MyFramework.framework -x assembler /Users/rolf/Projects/embedded-frameworks/simpleapp-with-framework/simpleapp-with-framework/obj/iPhone/Debug/mtouch-cache/simple-framework-binding.dll.arm64.s
>		ld: framework not found /Users/rolf/Projects/embedded-frameworks/simpleapp-with-framework/simpleapp-with-framework/obj/iPhone/Debug/mtouch-cache/MyFramework.framework
>		clang: error: linker command failed with exit code 1 (use -v to see invocation)
> MTOUCH: error MT3001: Could not AOT the assembly '/Users/rolf/Projects/embedded-frameworks/simpleapp-with-framework/simpleapp-with-framework/obj/iPhone/Debug/mtouch-cache/64/Build/simple-framework-binding.dll'
Comment 2 Rolf Bjarne Kvinge [MSFT] 2015-10-15 06:00:17 UTC

maccore/master: d99cf6f8552979094a64e91bd8b16f867c4eac2a

QA: unit tests were added.
Comment 4 Shruti 2015-10-27 04:02:19 UTC
Reproduce Status:
I have reproduced this issue using Alpha monotouch-
and observed build error MTOUCH: error MT3001 Could not AOT the assembly '/Users/ixamarin78/Downloads/embedded-frameworks-master/simpleapp-with-framework/simpleapp-with-framework/obj/iPhone/Debug/mtouch-cache/64/Build/simple-framework-binding.dll'
Screencast: http://www.screencast.com/t/UpQpC60Ul6

Verify Status:

I have checked this issue using Master monotouch- and did not get any build error.
Screencast: http://www.screencast.com/t/j0mvwyiaRBm8
Environment Info:https://gist.github.com/shrutis360/7c1cf5d50de7e2131a92

I will close this issue when we will get fix of this issue in C6 builds
Comment 5 Rolf Bjarne Kvinge [MSFT] 2015-10-27 17:41:13 UTC
Backported to maccore/cycle6-xi: a4258dcfeb881a09eee25ce9f124c898f296cc19
Comment 6 Udham Singh 2015-10-28 05:55:49 UTC
I have checked this issue with latest cycle6 lane builds and observed that the fix this issue has been merged with Cycle6 lane builds.

Environment Info : https://gist.github.com/Udham1/27a7e0a367e7167339b0