Bug 46521 - Linker error when building AWSSDK
Summary: Linker error when building AWSSDK
Status: RESOLVED NORESPONSE
Alias: None
Product: Android
Classification: Xamarin
Component: Linker (show other bugs)
Version: 7.1 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Radek Doulik
URL:
Depends on:
Blocks:
 
Reported: 2016-11-04 23:47 UTC by Stan H
Modified: 2017-10-04 16:48 UTC (History)
4 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Stan H 2016-11-04 23:47:04 UTC
both Android and iOS:

When I try to install the AWSSDK.S3 to access Amazon services, I get the following linker error when trying to build iOS:

Failed to resolve "System.Void Amazon.Runtime.Internal.Util.AESEncryptionPutObjectStream::.ctor(System.IO.Stream,System.Byte[],System.Byte[])" reference from "AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604"

..Android build has a similar error.

I have the following libraries installed:

AWSSDK.S3 v3.1.1.1 
AWSSDK.Core v3.3.4 
AWSSDK.SecurityToken v3.3.0.2 
AWSSDK.CognitolIdenity v3.3.0.2 
AWSSDK.CognitoIdentityProvider v3.3.1.2 
PCLCrypto v2.0.147 
PCLStorage v1.0.2

this appears to be a bug in AWSSDK.Core, but reporting here, because documentation here:
https://developer.xamarin.com/guides/ios/advanced_topics/linker/

says to please submit bug report "...If your application only works with -nolink"...which is the case here.

feel free to close if this is an AWS bug not fixable by Xamarin
Comment 2 Jon Douglas [MSFT] 2017-07-05 19:11:01 UTC
The issue here is that your application is linking out this item's constructor in the AWSSDK.Core library:

System.Void Amazon.Runtime.Internal.Util.AESEncryptionPutObjectStream::.ctor(System.IO.Stream,System.Byte[],System.Byte[])" reference from "AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604"

Now, is this your fault? Not really, it's partially the Linker to blame for being too aggressive, but also that this library probably doesn't preserve it's members and thus the linker links these items out.

I would consider this to be a bug on the AWSSDK.Core end where the maintainer could do a better job preserving the code:

https://developer.xamarin.com/guides/android/advanced_topics/linking/#Preserving_Code

Otherwise you can always mark this as a linkskip item:

https://developer.xamarin.com/guides/android/advanced_topics/linking/#linkskip

For a bit more information about why this happens, check out my blog on this topic: 

http://www.jon-douglas.com/2017/04/13/linker-bitdiffer/

I am marking this issue as NEEDINFO as we are missing a reproduction project that demonstrates this issue. Although this bug is a little old, we will need that to proceed investigation.
Comment 3 Jon Douglas [MSFT] 2017-10-04 16:48:01 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!

Note You need to log in before you can comment on or make changes to this bug.