Bug 25779 - Linking error when using GooglePlayServices v22 with XF 1.3
Summary: Linking error when using GooglePlayServices v22 with XF 1.3
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: PC Mac OS
: Highest normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 26083 ()
Depends on:
Blocks:
 
Reported: 2015-01-07 10:39 UTC by Prashant Cholachagudda
Modified: 2015-01-27 11:19 UTC (History)
12 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:
VERIFIED FIXED

Description Prashant Cholachagudda 2015-01-07 10:39:24 UTC
We get below build error on upgrading Xamarin forms to 1.3.0, the code complies in debug mode where the linker option is set to no link. 

The app is set to use API level 14 to 21 and compile target is 5.0. 
Xamarin.GooglePlayservices Lib version is 22.0.0.0

Error   5   The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'Android.Gms.Maps.Model.Marker Android.Gms.Maps.GoogleMap/InfoWindowClickEventArgs::get_P0()' (defined in 'Xamarin.Forms.Maps.Android, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null') from 'Xamarin.Forms.Maps.Android, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve Android.Gms.Maps.Model.Marker Android.Gms.Maps.GoogleMap/InfoWindowClickEventArgs::get_P0()
   at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
   at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
   at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
   at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   at Mono.Linker.Steps.MarkStep.Process()
   at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute()
   --- End of inner exception stack trace ---
   at Xamarin.Android.Diagnostic.Error(Int32 code, Exception innerException, 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() Werkak.Mobile.Android

Similar issues reported on the forums here:
http://forums.xamarin.com/discussion/29618/problem-building-in-release-mode-with-linking
http://forums.xamarin.com/discussion/29976/xamarin-forms-1-3-0-unable-to-compile-in-release-mode?new=1
Comment 1 narayanp 2015-01-08 09:38:21 UTC
I have tried to reproduce this issue and getting the same error mentioned in bug description. I followed the below steps to reproduce this issue:

1. Create Xamarin.Forms PCL project template.
2. Downgrade Xamarin.Forms to 1.3.0
3. Added Xamarin GooglePlayService version 22.0.0.0 to project.
4. Added Xamarin.Forms.Maps Version 1.3.0.6292 ( Mentioned  in http://forums.xamarin.com/discussion/29618/problem-building-in-release-mode-with-linking)
5. Set to use API level 14 to 21 and compile target is 5.0. 
6. Enabled the linker behavior ( Selected option "Link All Assemblies")
7. Build in Release mode.

Screencast: http://www.screencast.com/t/BnxbHemb6OVU
Error: https://gist.github.com/sunil360/ee58cde805f36637ea65
Build Output: https://gist.github.com/sunil360/b028b612dda3103f227c
Ide log: https://gist.github.com/sunil360/1881842c790fc0361bd8

Environment info:
=== Xamarin Studio ===

Version 5.7 (build 661)
Installation UUID: 561c7a69-0a91-4bae-ad7c-f0c79d594337
Runtime:
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: 8.6.0.50 (Business Edition)
Hash: 561dfed
Branch: 
Build date: 2015-01-06 17:56:14-0500

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/tajinder/Desktop/android-sdk-macosx
	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.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Build Information ===

Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 16:31:31-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7

=== Operating System ===

Mac OS X 10.8.4
Darwin Tajinders-iMac.local 12.4.2 Darwin Kernel Version 12.4.2
    Mon Jun 17 18:00:12 PDT 2013
    root:xnu-2050.45.8~1/RELEASE_X86_64 x86_64
Comment 2 Jason Smith [MSFT] 2015-01-15 16:52:01 UTC
Resolved in 1.3.2-pre1
Comment 5 Brendan Zagaeski (Xamarin Team, assistant) 2015-01-23 20:25:26 UTC
*** Bug 26083 has been marked as a duplicate of this bug. ***
Comment 6 eborovitski 2015-01-25 02:36:34 UTC
Jason, resolved how? Can you be more specific, pls

I've got all the software udated it seems and yet do not see that happening
I only see 1.3.0 pre-released for Forms.Maps though

What is it I missing here?

Thanks
Comment 7 web 2015-01-25 03:53:09 UTC
You should use Xamarins.Forms 1.3.2-pre1 with the correct settings (see http://forums.xamarin.com/discussion/31273/xamarin-forms-1-3-2-pre1-released). Using the suggested settings (first entry in thread), it works for me.
Comment 8 eborovitski 2015-01-26 06:04:09 UTC
Thanks a lot for pointing in the right direction!

For me it worked though only wneh i got Xamarin.Forms.Maps updated to 1.3.2.6299-pre1 as well.
Comment 9 narayanp 2015-01-27 11:19:15 UTC
I have checked this issue. I followed steps mentioned in comment 1 and comment 7 using Xamarin.Forms 1.3.2-pre1 and now this issue working fine as shown in the screencast: http://www.screencast.com/t/DefbCcmg

Hence closing this issue.

Environment info:
=== Xamarin Studio ===

Version 5.7.1 (build 15)
Installation UUID: 561c7a69-0a91-4bae-ad7c-f0c79d594337
Runtime:
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: 8.6.1.20 (Trial Edition)
Hash: 3b3ef43
Branch: 
Build date: 2015-01-24 09:42:21-0500

=== Xamarin.Android ===

Version: 4.20.0.28 (Trial Edition)
Android SDK: /Users/tajinder/Desktop/android-sdk-macosx
	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.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin.Mac ===

Version: 1.10.0.18 (Trial Edition)

=== Build Information ===

Release ID: 507010015
Git revision: ce24e991948c7f3d88b0194a14fc1996d848ef51
Build date: 2015-01-26 16:42:20-05
Xamarin addins: 6895e3222bfa6910524708aa0633ff3db99bc3a0

=== Operating System ===

Mac OS X 10.8.4
Darwin Tajinders-iMac.local 12.4.2 Darwin Kernel Version 12.4.2
    Mon Jun 17 18:00:12 PDT 2013
    root:xnu-2050.45.8~1/RELEASE_X86_64 x86_64