aws-samples / aws-sdk-unity-samples

This repository has samples that demonstrate various aspects of the AWS Mobile SDK for Unity, you can get the SDK source on Github (https://github.com/aws/aws-sdk-net)
Other
160 stars 112 forks source link

S3 demo does not work on Android? #11

Open flarb opened 8 years ago

flarb commented 8 years ago

The S3 demo seems to work fine in the editor but when I run it on Android I get exceptions all over the place. For instance, when I hit the ListObjects button, I get these (maybe to get this running on Android it needs some Manifest settings??) (using Unity 5 here)

I/Unity (25194):
I/Unity (25194): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64) I/Unity (25194): I/Unity (25194): NullReferenceException: Object reference not set to an instance of an object I/Unity (25194): at Amazon.Util.CryptoUtilFactory+CryptoUtil.ComputeSHA256Hash (System.Byte[] data) [0x00000] in :0 I/Unity (25194): at Amazon.Runtime.Internal.Auth.AWS4Signer.SetRequestBodyHash (IRequest request) [0x00000] in :0 I/Unity (25194): at Amazon.Runtime.Internal.Auth.AWS4Signer.SignRequest (IRequest request, Amazon.Runtime.ClientConfig clientConfig, Amazon.Runtime.Internal.Util.RequestMetrics metrics, System.String awsAccessKeyId, System.String awsSecretAccessKey) [0x00000] in :0 I/Unity (25194): at Amazon.S3.Internal.S3Signer.Sign (IRequest request, Amazon.Runtime.ClientConfig clientConfig, Amazon.Runtime.Internal.Util.RequestMetrics metrics, System.String awsAccessKeyId, System.String awsSecretAccessKey) [0x00000] in :0 I/Unity (25194): at Amazon.Runtime.Internal.Signer.SignRequest (IRequestContext requestContext) [0x00000] in :0 I/Unity (25194): at Amazon.Runtime.Internal.Signer.PreInvoke (IExecutionContext execut E/Unity (25194): An exception of type NullReferenceException was thrown from InvokeAsyncCallback(). E/Unity (25194):
E/Unity (25194): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64)


I/Unity (25194): Object reference not set to an instance of an object I/Unity (25194):
I/Unity (25194): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64) I/Unity (25194): I/Unity (25194): NullReferenceException: Object reference not set to an instance of an object I/Unity (25194): at AWSSDK.Examples.S3Example.m8 (Amazon.Runtime.AmazonServiceResult`2 responseObject) [0x00000] in :0 I/Unity (25194): at Amazon.S3.AmazonS3Client+cAnonStorey6D.<>m__76 (Amazon.Runtime.AmazonWebServiceRequest req, Amazon.Runtime.AmazonWebServiceResponse res, System.Exception ex, Amazon.Runtime.AsyncOptions ao) [0x00000] in :0 I/Unity (25194): at Amazon.Runtime.Internal.UnityMainThreadDispatcher.ProcessRequests () [0x00000] in :0 I/Unity (25194): UnityEngine.Debug:Internal_LogException(Exception, Object) I/Unity (25194): UnityEngine.Debug:LogException(Exception) I/Unity (25194): Amazon.Runtime.Internal.Util.UnityDebugLogger:Error(Exception, String, Object[]) I/Unity (25194): Amazon.Runtime.Internal.Util.Logger:Error(Exception, String, Object[]) I/Unity (25194): Amazon.Runtime.Internal.UnityMainThreadDispatcher:ProcessRequests() I/Unity (25194):
I/Unity (25194): (Filename: Line: -1) I/Unity (25194): E/Unity (25194): An unhandled exception was thrown from the callback method Amazon.S3.Model.ListObjectsRequest. E/Unity (25194):
E/Unity (25194): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 64) E/Unity (25194):

karthiksaligrama commented 8 years ago

I'm able to run the sample on device. It does look like the sample is failing on the callback. I would debug the callback and see what going on there.