Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWSSDK AmazonS3Config crashes on initialization with "MissingMethodException: Default constructor not found for type Amazon.Util.Internal.PlatformServices.NetworkReachability" error #1627

Closed
KAbakumov opened this issue Jun 2, 2020 · 4 comments

Comments

@KAbakumov
Copy link

KAbakumov commented Jun 2, 2020

I am getting the following error when trying to run AWSSDK on my Android Unity APP

Failed to load catalog from the internet. Falling back to local catalogSystem.TypeInitializationException: The type initializer for 'Amazon.S3.AmazonS3Config' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Amazon.Util.Internal.PlatformServices.ServiceFactory' threw an exception. ---> System.MissingMethodException: Default constructor not found for type Amazon.Util.Internal.PlatformServices.NetworkReachability
      at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0 
      at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <00000000000000000000000000000000>:0 
      at Amazon.Util.Internal.PlatformServices.ServiceFactory..ctor () [0x00000] in <00000000000000000000000000000000>:0 
      at Amazon.Util.Internal.PlatformServices.ServiceFactory..cctor () [0x00000] in <00000000000000000000000000000000>:0 
      at Amazon.Util.Internal.InternalSDKUtils.BuildUserAgentString (System.String 

I got Unity Packages from: http://sdk-for-net.amazonwebservices.com/latest/aws-sdk-unity.zip

Its version: aws-sdk-unity_3.3.750.0

I've added AWSSDK.S3.3.3.111.4.unitypackage to my project, and added references to all its libraries in my assembly references.

Works fine in Unity Editor buy I am getting that error on Android device

Expected Behavior

App runs correctly

Current Behavior

I am getting this error on startup

Possible Solution

Steps to Reproduce (for bugs)

Create Unity APP,
Download archive from http://sdk-for-net.amazonwebservices.com/latest/aws-sdk-unity.zip
Add S3 unity package to your project
Add all libraries to your assembly as references
(Maybe - add some code which uses S3 client)
Run on Android

Context

Your Environment

  • AWSSDK.Core version used: aws-sdk-unity_3.3.750.0
  • Service assembly and version used:
  • Operating System and version:
  • Visual Studio version:
  • Targeted .NET platform:

.NET Core Info

  • .NET Core version used for development:
  • .NET Core version installed in the environment where application runs:
  • Output of dotnet --info:
  • Contents of project.json/project.csproj:
@KAbakumov
Copy link
Author

Closing the issue - the problem is missing manifest. I've made another one for not working SDK on unity 2019+

@BatteryAcid
Copy link

For me this was a Unity build issue. I had to add a link.xml file to my Assets folder and list all the AWS SDK assemblies (Plugins) I'm using.
See https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/unity-special.html

@AnuragDubeyGame
Copy link

hi @BatteryAcid
Im facing a issue.
When I remove "minsdk" line from manifest.
the apk builds fine but as soon as I openit it crashes.
And if I delete the manifest now build is working properly there is no crash, but the AWS SDK is not working.

let me know if this was the issue faced by you?

@BatteryAcid
Copy link

Hey @AnuragDubeyGame, not sure what's going on there, if you need some more help you can drop by my discord, link in profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants