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.
Created attachment 16469 [details] Test case "Could not AOT the assembly ... Facebook.dll" when attempting to build for device in the Debug configuration with "Enable incremental builds" switched on ## Temporary Workaround Switch off "Project Options > Build > iOS Build > Enable incremental builds". ## Regression status: a bug in the Xamarin.Facebook.iOS library, exposed by the more precise AOT build process in Xamarin.iOS 9.8 BAD: Xamarin.Facebook.iOS 4.12.0 + Xamarin.iOS 9.8.1.4 (3cf8aae) BAD: Xamarin.Facebook.iOS 4.12.0 + Xamarin.iOS 9.8.0.323 (39ebb77) GOOD: Xamarin.Facebook.iOS 4.12.0 + Xamarin.iOS 9.6.2.4 (d8bedd0) Although Xamarin.iOS 9.6 does not hit this issue, the new behavior of the Xamarin.iOS 9.8 AOT process is in fact more "correct." The bug in this case is that none of the `.linkwith.cs` files in the Xamarin.Facebook.iOS library [1] specify a dependency on the CoreGraphics framework. Those `.linwith.cs` files will need to be updated to address this issue. [1] https://github.com/xamarin/FacebookComponents/tree/99dc441485910cbb0819360f4ce622f741abac60/Facebook.iOS/source/Facebook (For example, in my quick local tests, adding `Frameworks = "CoreGraphics"` at the end of the `LinkWith` attribute in `Frameworks = "CoreGraphics"` in `FBSDKCoreKit.linkwith.cs` was sufficient to stop the problem.) ## Steps to replicate Attempt to build the attached test case in the "Debug|iPhone" configuration. ### Steps followed to create the test case 1. Create a new Single View iPhone application. 2. Add the Xamarin.Facebook.iOS 4.12.0 NuGet package to the project. 3. Reference a type from the Facebook library in one of the C# files. For example, add the following line somewhere: var x = typeof (Facebook.CoreKit.AccessToken); ## BAD Results (on Xamarin.iOS 9.8) ### Error list > Error MT3001: Could not AOT the assembly '/Users/Shared/Projects/UnifiedSingleViewIphone1/UnifiedSingleViewIphone1/obj/iPhone/Debug/mtouch-cache/64/Build/Facebook.dll' ### Excerpt from the diagnostic build output > Process exited with code 1, command: > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang > -framework Foundation > -framework UIKit > /Users/Shared/Projects/UnifiedSingleViewIphone1/UnifiedSingleViewIphone1/obj/iPhone/Debug/mtouch-cache/Bolts.a > /Users/Shared/Projects/UnifiedSingleViewIphone1/UnifiedSingleViewIphone1/obj/iPhone/Debug/mtouch-cache/FBSDKCoreKit.a > /Users/Shared/Projects/UnifiedSingleViewIphone1/UnifiedSingleViewIphone1/obj/iPhone/Debug/mtouch-cache/FBSDKLoginKit.a > /Users/Shared/Projects/UnifiedSingleViewIphone1/UnifiedSingleViewIphone1/obj/iPhone/Debug/mtouch-cache/FBSDKMessengerShareKit.a > /Users/Shared/Projects/UnifiedSingleViewIphone1/UnifiedSingleViewIphone1/obj/iPhone/Debug/mtouch-cache/FBSDKShareKit.a > /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.0.323/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonosgen-2.0.dylib > /Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.0.323/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libxamarin-debug.dylib > -lz -ObjC -isysroot > /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk > -Qunused-arguments -miphoneos-version-min=8.0 -arch arm64 > -shared -read_only_relocs suppress -install_name > @executable_path/libFacebook.dll.dylib -fapplication-extension > -o > /Users/Shared/Projects/UnifiedSingleViewIphone1/UnifiedSingleViewIphone1/obj/iPhone/Debug/mtouch-cache/Facebook.dll.arm64.dylib > -x assembler > /Users/Shared/Projects/UnifiedSingleViewIphone1/UnifiedSingleViewIphone1/obj/iPhone/Debug/mtouch-cache/Facebook.dll.arm64.s > -DDEBUG > Undefined symbols for architecture arm64: > "_CGAffineTransformIdentity", referenced from: > -[FBSDKWebDialog _transformForOrientation] in FBSDKCoreKit.a(FBSDKWebDialog.o) > -[FBSDKWebDialog _updateViewsWithScale:alpha:animationDuration:completion:] in FBSDKCoreKit.a(FBSDKWebDialog.o) ## GOOD Results (on Xamarin.iOS 9.6) The `clang` command line includes 3 more framework options compared to Xamarin.iOS 9.8: -framework Accounts -framework CFNetwork -framework CoreGraphics The `clang` command line on Xamarin.iOS 9.6 also _omits_ a few options that are _present_ on Xamarin.iOS 9.8, but I believe those can be ignored for this particular issue: -fapplication-extension -lz -/Library/Frameworks/Xamarin.iOS.framework/Versions/9.8.0.323/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libxamarin-debug.dylib
Created attachment 16470 [details] Diagnostic build output, detailed version info
*** Bug 41234 has been marked as a duplicate of this bug. ***
*** Bug 41999 has been marked as a duplicate of this bug. ***
## Additional information from one of the duplicate bugs Why does disabling incremental builds help? > The reason this works when incremental builds is off, is that in that > case we build everything together at once, and there are other parts > of your app that makes us link with CoreGraphics. When incremental > builds are on, we build each assembly separately, and that also means > that the dependencies for each assembly must be correct.
Brendan, so this sounds like it can be fixed by the Xamarin.Facebook.iOS team. When can we expect a fix?
Added these frameworks in WeakFrameworks parameter: - Accounts - CoreLocation - Social - Security - QuartzCore - CoreGraphics - UIKit - Foundation - AudioToolbox As it states Facebook on its cocoapods spec: https://github.com/CocoaPods/Specs/blob/master/Specs/FBSDKCoreKit/4.13.1/FBSDKCoreKit.podspec.json#L20-L30 Adding these missing frameworks make the app build without a problem. This fix will be available on version 4.13.1.0 of Facebook iOS component or, for now until the component is released, you can build it by yourself in the following GitHub Xamarin repo: https://github.com/xamarin/FacebookComponents If you have any doubt, don't hesitate to ask. Greetings, Israel Soto --
Hi, Just to let you know this happens also with Google.SignIn.dll (from nuget package https://www.nuget.org/packages/Xamarin.Google.iOS.SignIn/) Thanks for the workaround and the fix
This is still happening with Google.MobileAds on iOS as well.
Valero, in your App project options, go to Build > iOS Build, select Debug configuration and iPhone platform and verify if you have checked "Enable incremental builds", if so, please uncheck that option and try to compile again. Let me know your status. Greetings, Israel Soto. --
Yes, disabling incremental builds solves the problem. It would be nice to be able to keep it enabled if at all possible though
@Valero, this is a known issue, we are working to solve it. You can follow the bug here: https://bugzilla.xamarin.com/show_bug.cgi?id=43689