Search Unity

Error when using Addressables and AWS Mobile SDK for Unity

Discussion in 'Addressables' started by epicwind, Jun 19, 2019.

Thread Status:
Not open for further replies.
  1. epicwind

    epicwind

    Joined:
    Mar 10, 2014
    Posts:
    2
    When using the AWSSDK library.Core.dll from this example https://docs.aws.amazon.com/mobile/sdkforunity/developerguide/what-is-unity-plugin.html

    And then add the package com.unity.addressables through the package Manager.

    Then the following error occurs
    Library\PackageCache\com.unity.scriptablebuildpipeline@1.5.0-preview\Editor\CacheServer\Client.cs(440,35): error CS0433: The type 'InvalidDataException' exists in both 'AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=null' and 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'


    And the question is how to fix it
     
  2. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    It looks to me like they have not updated the SDK since Unity migrated to a newer .NET standard. InvalidDataException was missing from Unity's .NET assemblies but is now not. You need to get rid of the implementation of InvalidDataException that the AWS SDK includes. In fact, you need to get rid of everything in here:

    https://github.com/aws/aws-sdk-net/tree/master/sdk/src/Core/Amazon.MissingTypes

    You may need to check through the GitHub repo of the SDK and see if there are any pull requests or active issues for this.
     
    Thaina, RobbyZ and epicwind like this.
  3. iohouse

    iohouse

    Joined:
    Jul 15, 2014
    Posts:
    10
  4. LittleBlueDot

    LittleBlueDot

    Joined:
    May 15, 2019
    Posts:
    16
    Hello, have you found a fix for this? Thanks.
     
  5. iohouse

    iohouse

    Joined:
    Jul 15, 2014
    Posts:
    10
  6. LittleBlueDot

    LittleBlueDot

    Joined:
    May 15, 2019
    Posts:
    16
    Thank you, I'll give it a go. I didn't realised that the 2.0 meant that it's a more up-to-date version, I thought it meant .NET 2.0 runtime. :)
     
  7. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Any luck with this? I dropped in the non-unity DLLS for .NET2.0 and it's missing seemingly critical stuff :(
     
  8. LittleBlueDot

    LittleBlueDot

    Joined:
    May 15, 2019
    Posts:
    16
    Sorry, didn't see this before now. I've got it working by adding a link.xml file into the Assets folder with the AWS dlls listed.
     
  9. mickee

    mickee

    Joined:
    Dec 26, 2013
    Posts:
    11
    Any update about this I am still getting the error?

    I am using 2019.3.9f1 and AWS SDK for DOT Net Unity package: aws-unity-sdk-v3-preview (AWSSDK.Lambda.3.1.2.5.unitypackage, AWSSDK.CognitoSync.3.1.0.5.unitypackage, AWSSDK.IdentityManagement.3.1.3.2.unitypackage).
     
  10. iohouse

    iohouse

    Joined:
    Jul 15, 2014
    Posts:
    10
    You need to use the .NET Standard 2.0 version of the AWS SDK for .NET here: https://github.com/aws/aws-sdk-net/issues/1371#issuecomment-541886433

    Additional reference here: https://github.com/aws/aws-sdk-net/issues/1262#issuecomment-535277796

    I can confirm this works as I am publishing a Unity 2018.4 LTS project with this AWS SDK (DynamoDB, Lambda, S3) and Addressables without any issues (both Android and iOS app stores).
     
  11. SevenMentor123

    SevenMentor123

    Joined:
    Dec 3, 2021
    Posts:
    1
Thread Status:
Not open for further replies.