Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by Serinx · Feb 07, 2017 at 02:46 AM · iosiphonexcodeamazonwebservice

AWS in iOS not working

Hello,

I have setup AWS in my Unity game and it works fine in the editor and on Android but when I test it on iOS it doesn't seem to access AWS properly.

I have added the NSAppTransportSecurity elements to my info.plist file but that doesn't seem to help.

If it helps, the services I'm using are Cognito and SimpleDB.

This is the error I get from the Xcode debugger when trying to access AWS:

 NullReferenceException: A null value was found where an object instance was required. at Amazon.AWSConfigs.get_LoggingConfig () [0x00000] in :0 at Amazon.Runtime.ClientConfig..ctor () [0x00000] in :0 at Amazon.CognitoIdentity.AmazonCognitoIdentityConfig..ctor () [0x00000] in :0 at Amazon.CognitoIdentity.AmazonCognitoIdentityClient..ctor (Amazon.Runtime.AWSCredentials credentials, Amazon.RegionEndpoint region) [0x00000] in :0 at Amazon.CognitoIdentity.CognitoAWSCredentials..ctor (System.String accountId, System.String identityPoolId, System.String unAuthRoleArn, System.String authRoleArn, Amazon.RegionEndpoint region) [0x00000] in :0 at GameControl.get_Credentials

This is how credentials is defined:

 private CognitoAWSCredentials _credentials;
 
 public CognitoAWSCredentials Credentials
 {
     get
     {
         if (_credentials == null)
             _credentials = new CognitoAWSCredentials("IDENTITY_POOL_HERE", RegionEndpoint.APSoutheast2);
         return _credentials;
     }
 }

Thanks for any help

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

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by umerPC · Jul 02, 2018 at 08:45 AM

I have fixed the problem with help from Unity support (Thanks Aurimas!)

In order to solve the issue, I had to add the following to my link.xml file.

The managed code stripper was removing types that were needed during compile time.

 <linker>
     <assembly fullname="log4net" preserve="all"/>
     <assembly fullname="System.Configuration" preserve="all"/>
 
 <assembly fullname = "System">
 <type fullname = "System.ComponentModel.NullableConverter">
 <method name = ".ctor">
 </type> 
  <type fullname = "System.ComponentModel.ReferenceConverter">
 <method signature = "System.Void .ctor(System.Type)" /> </type>
  </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 Senkh · Sep 11, 2018 at 03:19 PM 0
Share

I am having a similar problem with Aws. I stripped out everything from the project, and am trying to run a stored procedure from Aws Rds ( I know that's not usual standard practice, but this demands it).

All works well in Editor / Android / Pc, but iphone is breaking it. I get this error

 System.TypeInitializationException: The type initializer for 'Amazon.AWSConfigs' threw an exception. ---> 
 System.Configuration.ConfigurationErrorsException: Type 'System.Configuration.AppSettingsSection, 
 System.Configuration, Version=4.0.0.0, Culture=neutral, Public$$anonymous$$eyToken=b03f5f7f11d50a3a' not found.

Which seems like a dumb error, but I couldn't find the solution. It also seems to be a not so uncommon issue (https://github.com/aws/aws-sdk-ios/issues/581).

From the suggested solution here, these lines keep breaking my linker: ("UnityLinker.exe didn't run properly!")

  <type fullname = "System.Component$$anonymous$$odel.NullableConverter">
  <method name = ".ctor">
  </type> 
   <type fullname = "System.Component$$anonymous$$odel.ReferenceConverter">
  <method signature = "System.Void .ctor(System.Type)" /> </type>   



Any assistance would be greatly appreciated, my head is already hurting from hitting the wall so much.

my awsconfig.xml

 <?xml version="1.0" encoding="utf-8"?>
 <aws correctForClockSkew="true" region="eu-central-1">
   <logging logTo="UnityLogger" logResponses="Always" log$$anonymous$$etrics="true" log$$anonymous$$etricsFormat="JSON" />
   <s3 useSignatureVersion4="true" />
 </aws>

And my link.xml

    <linker>
       <!-- if you are using AWSConfigs.HttpClient.UnityWebRequest option-->
 
   <!--assembly fullname = "UnityEngine">
     <type fullname="UnityEngine.Networking.UnityWebRequest" preserve="all" />
     <type fullname = "UnityEngine.Networking.UploadHandlerRaw" preserve="all" />
     <type fullname = "UnityEngine.Networking.UploadHandler" preserve="all" />
     <type fullname = "UnityEngine.Networking.DownloadHandler" preserve="all" />
     <type fullname = "UnityEngine.Networking.DownloadHandlerBuffer" preserve="all" />
   </assembly-->
   <assembly fullname="log4net" preserve="all"/>
   <assembly fullname="System.Configuration" preserve="all"/>
 
 
   
   <assembly fullname = "mscorlib">
     <namespace fullname="System.Security.Cryptography" preserve="all"/>
   </assembly>
 
   <assembly fullname = "System" >
     <namespace fullname="System.Security.Cryptography" preserve="all"/>
     <!--type fullname = "System.Component$$anonymous$$odel.NullableConverter">
       <method name = ".ctor"/>
     </type>
     <type fullname = "System.Component$$anonymous$$odel.ReferenceConverter">
       <method signature = "System.Void .ctor(System.Type)" />
     </type-->
   </assembly>
 
   <assembly fullname = "AWSSD$$anonymous$$.Core" preserve="all">
     <namespace fullname="Amazon.Util.Internal.PlatformServices" preserve="all"/>
   </assembly>
   
   <assembly fullname = "AWSSD$$anonymous$$.CognitoIdentity" preserve="all"/>
   <assembly fullname = "AWSSD$$anonymous$$.SecurityToken" preserve="all"/>

   
 </linker>
avatar image umerPC Senkh · Sep 14, 2018 at 08:30 AM 0
Share

I had the unitylinker.exe did not run properly. The problem was related to the version of unity I was using, as it had a bug. Can't remember what the version was, but when I updated it to a newer release it got rid of that error!

avatar image umerPC · Jul 18, 2019 at 03:00 PM 0
Share

I just upgraded to a newer unity version and the above method no longer works.

If you are experiencing this bug when switching to IL2CPP , the following fix worked for me on android:

1) Navigate to : C:\Program Files\Unity\Hub\Editor\2018.3.12f1\Editor\Data\$$anonymous$$onoBleedingEdge\lib\mono\unityjit 2) copy and paste these .dlls -system core,systemconfiguration,$$anonymous$$ono.Posix.dll into the desired platform you're building to . e.g. Assets/Plugins/Android.

For ios : 1) Navigate to Fix : C:\Program Files\Unity\Hub\Editor\2018.3.12f1\Editor\Data\$$anonymous$$onoBleedingEdge\lib\mono\unityjit 2) copy and paste these .dlls -system core,systemconfiguration

avatar image AdamBebko umerPC · Dec 01, 2020 at 04:14 PM 0
Share

Does it need to be unity 2018? it doesn't seem to be working from the folder in unity 2020.1.15

avatar image
0

Answer by Gwom · Oct 20, 2020 at 05:02 PM

Not sure if it was switching to Mono from IL2CPP but here is my link.xml that is in the root folder (in case anyone needs it):

  <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

92 People are following this question.

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

Related Questions

iphone sound disappearance - ios build or hardware issue? 2 Answers

The presence of 3rd party libraries in our Unity XCode project causes mono-land exceptions leading to a crash immediately after startup. 2 Answers

Stop Threads in Unity3d using C# 0 Answers

EXC_BAD_ACCESS from Unity::Material::CreateMaterial When running simple app on iPhone. 3 Answers

iPhone Virtual Reality App won't load onto my phone. 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