Bug 42104 - [iOS] Xamarin.Forms.Theme.Base adhoc linking fails with Could not AOT the assembly
Summary: [iOS] Xamarin.Forms.Theme.Base adhoc linking fails with Could not AOT the ass...
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler ()
Version: XI 9.6 (iOS 9.3)
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2016-06-23 11:37 UTC by Thomas Hagström
Modified: 2016-08-02 16:24 UTC (History)
4 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 NORESPONSE

Description Thomas Hagström 2016-06-23 11:37:55 UTC
Tools:
- Windows 10
- Visual Studio 2015 Update 2
- Xamarin 4.1.1.3
- Xamarin.iOS 9.8.1.4

Packages:
- Xamarin.Forms 2.3.0.49
- Xamarin.Forms.Theme.Base 1.0.0.43-pre1
- Xamarin.Forms.Theme.Light 1.0.0.43-pre1

Expected

Build and run on device without error

Actual

Build error:

"Severity	Code	Description	Project	Project Rank	File	Line	Suppression State
Error		Could not AOT the assembly '/Users/[user]/Library/Caches/Xamarin/mtbs/builds/[app]/8ea50dcf176c3209abb04cc5591f3004/obj/iPhone/Ad-Hoc/mtouch-cache/64/Build/Xamarin.Forms.Theme.Base.dll'	[app].iOS	4	C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets	681"	

Reason:
Building in Ad-Hoc with Linker set to "Links SDK assemblies only" (iOS proj propersties > iOS Build > General) causes issues with Xamarin.Forms.Theme.Base due to various dependencies not being linked.

Workaround:
A tiresome process of building (which is extremely slow for adhoc PC > Mac) and finding the build output (-v -v -v -v) errors such as below and adding each System dll to my Linking.xml file.

"Mono Ahead of Time compiler - compiling assembly /Users/[user]/Library/Caches/Xamarin/mtbs/builds/[app]/.../obj/iPhone/Ad-Hoc/mtouch-cache/64/Build/Xamarin.Forms.Theme.Base.dll
1>  Could not load signature of Xamarin.Forms.Themes.CapitalizationConverter:Convert due to: Could not load file or assembly or one of its dependencies. assembly:System.Globalization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:<none>"
Comment 1 Rolf Bjarne Kvinge [MSFT] 2016-06-23 14:42:56 UTC
> "Mono Ahead of Time compiler - compiling assembly
> /Users/[user]/Library/Caches/Xamarin/mtbs/builds/[app]/.../obj/iPhone/Ad-Hoc/
> mtouch-cache/64/Build/Xamarin.Forms.Theme.Base.dll
> 1>  Could not load signature of
> Xamarin.Forms.Themes.CapitalizationConverter:Convert due to: Could not load
> file or assembly or one of its dependencies. assembly:System.Globalization,
> Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
> type:<unknown type> member:<none>"

Something is referencing in the wrong version of System.Globalization (it should be 2.0.5.0, but it's 4.0.0.0).

Could you please attach a complete diagnostic build log?
Comment 2 Manuel de la Peña [MSFT] 2016-08-02 16:24:51 UTC
We have not received the requested information. If you are still 
experiencing this issue please provide all the requested information 
and re-open the bug report. Thanks!