Aws-sdk-net: [UNITY][ISSUE]Conflict between native System.IO.InvalidDataException & yours

Created on 7 Dec 2018  路  13Comments  路  Source: aws/aws-sdk-net

In Unity when we import your package everything is fine but as soon as another script try to access to
"System.IO.InvalidDataException" it will create a conflict and the compiler can't resolve.
We are using :

  • Windows 10
  • Unity 2018.3
  • aws-sdk-unity_3.3.421.0 (AWSSDK 3.3.31.0)
  • .NET 4.6 OR .netstandard 2.0
  • VS Community 2017
    AND CURRENTLY it's impossible to compile in Unity.

This is the incriminated script :

/*
 * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 * 
 *  http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

using System;
using System.Runtime.Serialization;

namespace System.IO {
    [Serializable()] 
    public sealed class InvalidDataException  : SystemException
    {
        public InvalidDataException ()
            : base() {
        }

        public InvalidDataException (String message)
            : base(message) {
        }

        public InvalidDataException (String message, Exception innerException)
            : base(message, innerException) {
        }

        internal InvalidDataException (SerializationInfo info, StreamingContext context) : base(info, context) {
        }

    }
}

if you called just this script in Unity project, you will generate the issue :

using UnityEngine;

public class Test : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        throw new System.IO.InvalidDataException();
    }
}

Why are you keeping this, whereas it's implemented in System.IO C# library ?

You can just removed it no or use at least a custom namespace if you want to have your own InvalidDataException ?
But when I see your implementation it seems to be just a complete empty nutshell that could just create issue.

Thanks.

Unity bug modulunity

All 13 comments

Any news ?

got the same problem... have no clue why that been done this way

I have downloaded the newest sdk for Unity and this issue still happen.
Any solution for this?

@klaytaybai do you have any news on this ?

[UPDATED 1]
I have tried the method below and it doesn't work. I have been thinking if there is some kind of dll extractor so it can do something like unzip the dll into the original script. And after that I just need to remove the duplicate 'InvalidDataException.cs'
Any other solutions? Thanks before.

[ORIGINAL POST]
Well I found this in the archive:
https://github.com/amazon-archives/aws-sdk-unity
Haven't really tried it because the last update time is 3 years ago.

If there is any package or some link that I can download the raw format (.cs and others), not the .dll format, it would be much helpful since I can just delete the temporary 'InvalidDataException.cs' script anyway

@sstevenkang @normj Any news regarding this Issue? Currently AWS SDK is unusable in Unity 2018.

Has anyone found a workaround/update to this issue?

my workaround:

  • checkout newest master, open Unity.sln
  • remove InvalidDataException.cs from Core project
  • set TargetFrameworkVersion to 4.0
  • rebuild solution

Thanks, that worked for me (wasn't able to figure out how to set TargetFrameworkVersion, but haven't hit an error yet either)

This currently means that you CANNOT use the AWS SDK with Unity.

When is this being fixed?

I can't build AWSSDK.Unity.sln.. getting UnityEngine not found error. I have installed Unity on a standard location in Mac. Does this only work in Windows?

@gamedev2492 are you blaming me for an aws trouble? 馃

Is this still an issue? The last time I download the SDK, it has already been solved. Don't know if it happens again on the latest one. I haven't used it for a while.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ShahriatHossain picture ShahriatHossain  路  4Comments

Rodrigo-Andrade picture Rodrigo-Andrade  路  3Comments

genifycom picture genifycom  路  4Comments

Lapeno94 picture Lapeno94  路  4Comments

berkeleybross picture berkeleybross  路  3Comments