Bug 21975 - Default Forms Shared project on Android does not work
Summary: Default Forms Shared project on Android does not work
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.2
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-08-09 07:54 UTC by ilya.golovach
Modified: 2016-03-16 12:05 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 FIXED

Description ilya.golovach 2014-08-09 07:54:50 UTC
Created default Shared forms project and updated packages to the latest one (Forms -> 1.2.2)

Compiling with Linker set to something other than Don't link does not work:
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(5,5): Error MSB4018: The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'System.Runtime.CompilerServices.ConditionalWeakTable`2' (defined in 'Xamarin.Forms.Core, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null') from 'Xamarin.Forms.Core, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null' could not be resolved.
   at Xamarin.Android.Diagnostic.Error(Int32 code, String message, Object[] args)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() (MSB4018) (TestForms.Android)



Compiling with "Don't link" option works but the app throws runtime error:
System.TypeLoadException: Could not load type 'Xamarin.Forms.BindingBase[]' from assembly 'Xamarin.Forms.Core, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null'.
  at at System.Collections.Generic.Dictionary`2<Xamarin.Forms.BindableProperty, Xamarin.Forms.BindingBase>.InitArrays (int) <0x00167>
  at at System.Collections.Generic.Dictionary`2<Xamarin.Forms.BindableProperty, Xamarin.Forms.BindingBase>.Init (int,System.Collections.Generic.IEqualityComparer`1<Xamarin.Forms.BindableProperty>) <0x001d3>
  at at System.Collections.Generic.Dictionary`2<Xamarin.Forms.BindableProperty, Xamarin.Forms.BindingBase>..ctor (int) <0x00063>
  at at Xamarin.Forms.BindableObject..ctor () <IL 0x00002, 0x00063>
  at at Xamarin.Forms.Element..ctor () <IL 0x00018, 0x000ef>
  at at Xamarin.Forms.VisualElement..ctor () <IL 0x00080, 0x0017f>
  at at Xamarin.Forms.Page..ctor () <IL 0x0000c, 0x0009b>
  at at Xamarin.Forms.ContentPage..ctor () <IL 0x00001, 0x00043>
  at TestForms.App.GetMainPage () [0x00001] in c:\Users\ingweland\Documents\Projects\TestForms\TestForms\App.cs:10
  at TestForms.Android.MainActivity.OnCreate (Android.OS.Bundle) [0x00011] in c:\Users\ingweland\Documents\Projects\TestForms\Android\MainActivity.cs:25
  at at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) <IL 0x00013, 0x000ef>
  at at (wrapper dynamic-method) object.f197fe0c-e9c2-4559-8a72-c0d0b0f7b31e (intptr,intptr,intptr) <IL 0x00017, 0x00043>

My Xamarin setup:
=== Xamarin Studio ===

Version 5.2 (build 386)
Installation UUID: e637908b-5efa-4ea7-97ad-dcce8a6cddcd
Runtime:
	Microsoft .NET 4.0.30319.18408
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.25

=== Xamarin.Android ===

Version: 4.10.2 (Business Edition)
Android SDK: C:\Users\ingweland\AppData\Local\Android\android-sdk
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing)

=== Build Information ===

Release ID: 502000386
Git revision: e6a54dee5376e6e7a2d9982695b060fddc09e65d
Build date: 2014-08-04 14:07:09-04
Xamarin addins: 2b5a5c26ac2ee74c6e91a8d24ef44d0ca9cb74d0

=== Operating System ===

Windows 6.1.7601.65536 (64-bit)
Comment 1 Parmendra Kumar 2014-08-12 14:44:34 UTC
I have tried to reproduce this, With following steps:
1. Create a Xamarin.Forms Shared project.
2. Build successfully.
3. Update the Package.
4. Run successfully.

I am unable to reproduce this issue,Let me know if I am missing anything.
Could you please give us some steps or sample project to reproduce it.

Environment info:

=== Xamarin Studio ===

Version 5.2 (build 386)
Installation UUID: cb62b6ae-8989-4785-b7db-d8ae2b09cd1f
Runtime:
	Microsoft .NET 4.0.30319.34003
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.25

=== Xamarin.Android ===

Version: 4.14.0 (Business Edition)
Android SDK: C:\Users\Saurabh\Desktop\android-sdk
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0.3 (API level 15)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: C:\Program Files\Java\jdk1.6.0_31
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode)

=== Build Information ===

Release ID: 502000386
Git revision: e6a54dee5376e6e7a2d9982695b060fddc09e65d
Build date: 2014-08-04 14:07:09-04
Xamarin addins: 2b5a5c26ac2ee74c6e91a8d24ef44d0ca9cb74d0

=== Operating System ===

Windows 6.2.9200.0
Comment 2 Jason Smith [MSFT] 2016-03-16 12:05:39 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we no longer believe it affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
 
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team