Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by Durston88 · Jun 18, 2016 at 05:41 AM · linkamazonassembliesstripping

Can't seem to get link.xml working with AWS SDK

Hi, having a horribly difficult time here, been trying to fix this for hours...

We're using the AWS SDK and it seems to be getting stripped, specifically a constructor inside one of the assemblies. This is the error we're encountering in Xcode when the games runs on a device:

 MissingMethodException: Method not found: 'Default constructor not found...ctor() of Amazon.Util.Internal.PlatformServices.NetworkReachability'.

I've tried setting up the link.xml file in both of the following ways:

 <linker>
 
 <assembly fullname="AWSSDK.Core" preserve="all"/>
 <assembly fullname="AWSSDK.CognitoIdentity" preserve="all"/>
 <assembly fullname="AWSSDK.SecurityToken" preserve="all"/>
 <assembly fullname="AWSSDK.DynamoDBv2" preserve="all"/>
 
 <assembly fullname="UnityEngine">
     <type fullname="UnityEngine.Experimental.Networking.UnityWebRequest" preserve="all" />
     <type fullname="UnityEngine.Experimental.Networking.UploadHandlerRaw" preserve="all" />
     <type fullname="UnityEngine.Experimental.Networking.UploadHandler" preserve="all" />
     <type fullname="UnityEngine.Experimental.Networking.DownloadHandler" preserve="all" />
     <type fullname="UnityEngine.Experimental.Networking.DownloadHandlerBuffer" preserve="all" />
 </assembly>
 
 <assembly fullname="mscorlib">
     <namespace fullname="System.Security.Cryptography" preserve="all"/>
 </assembly>
 
 <assembly fullname="System">
     <namespace fullname="System.Security.Cryptography" preserve="all"/>
 </assembly>
 
 </linker>

...and this way...

 <linker>
 
 <assembly fullname="AWSSDK.Core">
    <namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all"/>
 </assembly>
 <assembly fullname="AWSSDK.CognitoIdentity">
    <namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all"/>
 </assembly>
 <assembly fullname="AWSSDK.SecurityToken">
    <namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all"/>
 </assembly>
 <assembly fullname="AWSSDK.DynamoDBv2">
    <namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all"/>
 </assembly>
 
 <assembly fullname="UnityEngine">
     <type fullname="UnityEngine.Experimental.Networking.UnityWebRequest" preserve="all" />
     <type fullname="UnityEngine.Experimental.Networking.UploadHandlerRaw" preserve="all" />
     <type fullname="UnityEngine.Experimental.Networking.UploadHandler" preserve="all" />
     <type fullname="UnityEngine.Experimental.Networking.DownloadHandler" preserve="all" />
     <type fullname="UnityEngine.Experimental.Networking.DownloadHandlerBuffer" preserve="all" />
 </assembly>
 
 <assembly fullname="mscorlib">
     <namespace fullname="System.Security.Cryptography" preserve="all"/>
 </assembly>
 
 <assembly fullname="System">
     <namespace fullname="System.Security.Cryptography" preserve="all"/>
 </assembly>
 
 </linker>


Neither of them seem to be working. Using the Assembly Browser in Mono and switching between C# and IL, I can see IL is missing the constructor that is clearly present in C#.

Any help would be greatly appreciated, running out of things to try. Thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Durston88 · Jun 21, 2016 at 09:25 PM

So I did actually figure this out. Eventually I got it working by using the second method and also manually setting the import settings on the libraries from "Any Platform" to "iOS, Android, Editor".

This let it run and connect to DynamoDB, but then it was unable to parse the data (or something), giving the error "Type System.String is unsupported, it cannot be instantiated". This was fixed by reverting the Dynamo assembly line back to the original format. Anyway, if none of that makes sense, this is what it ended up looking like:

 <linker>
 
 <assembly fullname="UnityEngine">
     <type fullname="UnityEngine.Experimental.Networking.UnityWebRequest" preserve="all" />
     <type fullname="UnityEngine.Experimental.Networking.UploadHandlerRaw" preserve="all" />
     <type fullname="UnityEngine.Experimental.Networking.UploadHandler" preserve="all" />
     <type fullname="UnityEngine.Experimental.Networking.DownloadHandler" preserve="all" />
     <type fullname="UnityEngine.Experimental.Networking.DownloadHandlerBuffer" preserve="all" />
 </assembly>
 
 <assembly fullname="mscorlib">
     <namespace fullname="System.Security.Cryptography" preserve="all"/>
 </assembly>
 
 <assembly fullname="System">
     <namespace fullname="System.Security.Cryptography" preserve="all"/>
 </assembly>
 
 
 <assembly fullname="AWSSDK.Core">
     <type fullname="Amazon.Util.Internal.PlatformServices.NetworkReachability" preserve="all"/>
    <namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all"/>
 </assembly>
 <assembly fullname="AWSSDK.CognitoIdentity">
    <namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all"/>
 </assembly>
 <assembly fullname="AWSSDK.SecurityToken">
    <namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all"/>
 </assembly>
 <assembly fullname="AWSSDK.DynamoDBv2" preserve="all"/>
 
 </linker>
 
Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image rself · Jul 09, 2016 at 03:01 PM 0
Share

Bah, it is escaping the code snippets sorry. Using '[]' ins$$anonymous$$d of '<>'. Hey JumpDog, I am having the same "Type System.String is unsupported, it cannot be instantiated" issue, but reverting that back to the suggested format:

    [assembly fullname="AWSSD$$anonymous$$.DynamoDBv2" preserve="all" /]

didn't work for me. I also tried:

    [assembly fullname="AWSSD$$anonymous$$.DynamoDBv2"]
        [namespace fullname="Amazon.DynamoDBv2.Data$$anonymous$$odel" preserve="all" /]
      [/assembly]
And
    [assembly fullname="AWSSD$$anonymous$$.DynamoDBv2"/]

And

    [assembly fullname="AWSSD$$anonymous$$.DynamoDBv2"]
        [namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all" /]
      [/assembly]
No luck though. Any additional things you can think to try? Thanks!

avatar image Durston88 · Jul 10, 2016 at 08:31 PM 0
Share

Not sure, what I wrote above is what worked for me. I actually tried changing the import setting on those files back to "Any Platform" just now to see if that played a part, to make sure you did that too if so... but doesn't seem like that was part of it after all. If anything comes to $$anonymous$$d I'll post again but you tried what did it for me. Good luck.

avatar image rself Durston88 · Jul 15, 2016 at 09:06 PM 0
Share

@JumpDog no worries thanks for trying. I ended up changing each one to:

  [assembly fullname="AWSSD$$anonymous$$.CognitoIdentity"]
    [type fullname="Amazon.*" preserve="all" /]
    [namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all" /]
  [/assembly]
And that worked for me. Hopefully that helps someone else making the transition.

avatar image noamgat · Jul 19, 2016 at 03:31 AM 0
Share

Thanks guys! This was tremendously helpful. For those wondering WHY this fix is needed:

https://docs.unity3d.com/$$anonymous$$anual/iphone-playerSizeOptimization.html preserve="all" on an assembly only works in IL2CPP builds.

I guess amazon mostly did QA on iPhone, not on anrdoid using the $$anonymous$$ono2X scripting backend...

avatar image
0

Answer by scottstephan · Dec 11, 2016 at 04:59 PM

This is a silly question, but where is link.xml meant to be? In /Assets ? Is that the assembly root?

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Durston88 · Dec 11, 2016 at 09:07 PM 1
Share

Yes, in the base Assets folder.

avatar image
0

Answer by RedHatJef · Jul 04, 2019 at 09:55 PM

I ran into this to trying to get GameLift to work. No combination of anything I tried could make this work. The solution was to refer to the example unity project amazon provides with their AWSSDK.

Basically, just include this in the base Assets folder:

https://github.com/aws/aws-sdk-net/blob/master/sdk/test/Unity/Unity3DTests/Assets/link.xml

Once I did this, and rebuilt projects, it just magically worked.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AdamBebko · Nov 24, 2020 at 08:47 PM 0
Share

link broken

avatar image
0

Answer by Gwom · Oct 20, 2020 at 04:57 PM

Had a slightly different link.xml, moved it to the root of the asset folder, really not sure if it was this or changing from IL2CPP to Mono but finally got it working.

  <linker>
  
  <assembly fullname="UnityEngine">
      <type fullname="UnityEngine.Experimental.Networking.UnityWebRequest" preserve="all" />
      <type fullname="UnityEngine.Experimental.Networking.UploadHandlerRaw" preserve="all" />
      <type fullname="UnityEngine.Experimental.Networking.UploadHandler" preserve="all" />
      <type fullname="UnityEngine.Experimental.Networking.DownloadHandler" preserve="all" />
      <type fullname="UnityEngine.Experimental.Networking.DownloadHandlerBuffer" preserve="all" />
  </assembly>
  
  <assembly fullname="mscorlib">
      <namespace fullname="System.Security.Cryptography" preserve="all"/>
  </assembly>
  
  <assembly fullname="System">
      <namespace fullname="System.Security.Cryptography" preserve="all"/>
  </assembly>
  
  <assembly fullname="AWSSDK.Core" preserve="all"/>
  <assembly fullname="AWSSDK.CognitoIdentity" preserve="all"/>
  <assembly fullname="AWSSDK.SecurityToken" preserve="all"/>
  <assembly fullname="log4net" preserve="all"/>
  <assembly fullname="System.Configuration" preserve="all"/>
 
  <assembly fullname="AWSSDK.Core">
      <type fullname="Amazon.Util.Internal.PlatformServices.NetworkReachability" preserve="all"/>
     <namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all"/>
  </assembly>
  <assembly fullname="AWSSDK.CognitoIdentity">
     <namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all"/>
  </assembly>
  <assembly fullname="AWSSDK.SecurityToken">
     <namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all"/>
  </assembly>
  <assembly fullname="AWSSDK.DynamoDBv2" preserve="all"/>
  
  </linker>

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

link.xml for a monobehaviour? 1 Answer

Using HttpWebRequest when Stripping Assemblies 1 Answer

Best way to preserve a class from Code Stripping 0 Answers

Open link in new tab from webplayer hosted on any site. 3 Answers

Make NavMesh Agent Jump on Off-Mesh Links 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges