aws-samples / aws-samples/aws-sdk-unity-samples
MobileAnalytics Sample nullpointer exception
- Dominant language
- C#
- Stars
- 163
- Forks
- 107
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
First time using AWS and I'm trying to use the mobile analytics but I can't seem to make it work on either IOS nor Android. I followed the tutorial by the letter, making sure everything was exactly like the tutorial asks and I still can't make it work. Here's the IOS exception being thrown on load:
```
NullReferenceException: A null value was found where an object instance was required.
at Amazon.AWSConfigs.GetSection[T] (System.String sectionName) [0x00000] in :0
at Amazon.Util.Internal.RootConfig..ctor () [0x00000] in :0
at Amazon.AWSConfigs..cctor () [0x00000] in :0
at Amazon.Runtime.Internal.Util.Logger.ConfigureLoggers () [0x00000] in :0
at Amazon.Runtime.Internal.Util.Logger..ctor (System.Type type) [0x00000] in :0
at Amazon.Runtime.Internal.Util.Logger.GetLogger (System.Type type) [0x00000] in :0
at Amazon.UnityInitializer.Awake () [0x00000] in :0
at UnityEngine.GameObject.AddComponent[T] () [0x00000] in :0
at Amazon.UnityInitializer.AttachToGameObject (UnityEngine.GameObject gameObject) [0x00000] in :0
at AWSSDK.Examples.AmazonMobileAnalyticsSample.Start () [0x00000] in :0
Rethrow as TypeInitializationException: The type initializer for 'Amazon.AWSConfigs' threw an exception.
at Amazon.Runtime.Internal.Util.Logger.ConfigureLoggers () [0x00000] in :0
at Amazon.Runtime.Internal.Util.Logger..ctor (System.Type type) [0x00000] in :0
at Amazon.Runtime.Internal.Util.Logger.GetLogger (System.Type type) [0x00000] in :0
at Amazon.UnityInitializer.Awake () [0x00000] in :0
at UnityEngine.GameObject.AddComponent[T] () [0x00000] in :0
at Amazon.UnityInitializer.AttachToGameObject (UnityEngine.GameObject gameObject) [0x00000] in :0
at AWSSDK.Examples.AmazonMobileAnalyticsSample.Start () [0x00000] in :0
Rethrow as TypeInitializationException: The type initializer for 'Amazon.Util.Internal.AmazonHookedPlatformInfo' threw an exception.
at Amazon.UnityInitializer.Awake () [0x00000] in :0
at UnityEngine.GameObject.AddComponent[T] () [0x00000] in :0
at Amazon.UnityInitializer.AttachToGameObject (UnityEngine.GameObject gameObject) [0x00000] in :0
at AWSSDK.Examples.AmazonMobileAnalyticsSample.Start () [0x00000] in :0
UnityEngine.GameObject:AddComponent()
Amazon.UnityInitializer:AttachToGameObject(GameObject)
AWSSDK.Examples.AmazonMobileAnalyticsSample:Start()
(Filename: currently not available on il2cpp Line: -1)
Attached unity initializer to AmazonMobileAnalyticsSample
UnityEngine.Logger:Log(LogType, Object)
AWSSDK.Examples.AmazonMobileAnalyticsSample:Start()
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
NullReferenceException: A null value was found where an object instance was required.
at Amazon.AWSConfigs.set_EndpointDefinition (System.String value) [0x00000] in :0
at Amazon.RegionEndpoint.LoadEndpointDefinitions () [0x00000] in :0
at Amazon.RegionEndpoint.GetBySystemName (System.String systemName) [0x00000] in :0
at AWSSDK.Examples.AmazonMobileAnalyticsSample.Start () [0x00000] in :0
(Filename: currently not available on il2cpp Line: -1)
```
And just in case I did something wrong, here's the link.xml file, located in the Assets folder root
```
```
and the awsconfig.xml, located in Assets/Resources
```
region="us-east-1"
logTo="UnityLogger"
logResponses="Always"
logMetrics="true"
logMetricsFormat="JSON"
```
the rest of the project is untouched except for my poolID and my appID. I'm on Unity 5.3.5f1
Contributor guide
Assessment
This issue has not been assessed yet.