Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

496
Views
The type initializer for 'Amazon.AWSConfigs' threw an exception

I'm trying to log in using AWS Cognito by running the app after building it in Unity.

I couldn't log in properly, and when I tried debugging, I found the phrase "The type initializer for Amazon.AWSConfigs' thread an exception."

This error occurs when executing the following code:

Amazon.CognitoIdentityProvider.AmazonCognitoIdentityProviderClient provider =
            new Amazon.CognitoIdentityProvider.AmazonCognitoIdentityProviderClient(new Amazon.Runtime.AnonymousAWSCredentials(), regionTable[REGION]);

The app itself is built normally, but there seems to be a problem with logging in using AWS.

(I found this error in the PC and oculus environment.)

  • Some of the answers told me to modify the Config file. But I couldn't find the Config file. The location of this file was also unknown.

  • I found this answer "https://github.com/aws/aws-sdk-net/issues/310" but I couldn't apply this for me.

  • I found this Document "https://docs.unity3d.com/kr/2021.1/Manual/upm-config.html#upmconfig" but the Config file didn't exist in this path. My environment is Mac.

additionally,

I use AWS SDK called aws-sdk-net45-3.7.193.0.

UnityInitializer.AttachToGameObject(this.gameObject);
Amazon.AWSConfigs.HttpClient = Amazon.AWSConfigs.HttpClientOption.UnityWebRequest;

In this code, my Project Cannot understand UnityInitializer, HttpClient, and HttpClientOption.

What else changes are needed in order to mitigate the above issue.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I solved this problem.

The problem was that I was using IL2CPP as Script backend.

Simply using Script backend as Mono is one way. But my project had to use IL2CPP.

In order to use IL2CPP and use the Unity project using AWS Cognito, it is recommended that you:

  • Use .NetStandard2.0.
  • Use AWS SDK that is compatible with .NetStandard 2.0.

I used Unity 2020.3.19f version to use .NetStandard 2.0.

If you are using a URP project and there is an error in URP due to downgrade of Unity version, it is recommended that you act as follows.

  • Enter the Package folder for that project
  • Open Manifest.json and Package-lock.json files
  • Change the Render Pipeline version to 10.8.1 (for 2020.3.19f1 version. I didn't experiment with other versions.)

Reference found to resolve this issue.

https://forum.unity.com/threads/issue-with-system-configuration-configurationmanager-get_appsettings-on-ios.1026877/#post-6656764

https://docs.aws.amazon.com/ko_kr/mobile/sdkforunity/developerguide/aws-unity-sdk.pdf

https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@10.8/manual/index.html

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!