elringus / unity-google-drive

Google Drive SDK for Unity game engine
https://forum.unity.com/threads/515360
MIT License
404 stars 64 forks source link

iOS authentication is failing in latest version #18

Closed josephnarai closed 6 years ago

josephnarai commented 6 years ago

This was working fine, but coming back to retest now (after all the new features), the iOS authentication is failing now.

Failed to execute authorization procedure. Check application settings and credentials.

We tried changing to 4.6 scripting - but that breaks the entire app on iOS and downloads stop working on Android :(

Please advise how best to debug and fix this?

Joe

josephnarai commented 6 years ago

StartSyncFiles Down:True UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) GoogleDrive:StartSyncFiles(Boolean, String) GoogleDrive:OnGoogleDownButtonClickHandler() UnityEngine.Events.UnityAction:Invoke() UnityEngine.Events.InvokableCall:Invoke() UnityEngine.Events.UnityEvent:Invoke() UnityEngine.UI.Button:Press() UnityEngine.UI.Button:OnPointerClick(PointerEventData) UnityEngine.EventSystems.ExecuteEvents:Execute(IPointerClickHandler, BaseEventData) UnityEngine.EventSystems.EventFunction1:Invoke(T1, BaseEventData) UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents() UnityEngine.EventSystems.StandaloneInputModule:Process() UnityEngine.EventSystems.EventSystem:Update()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

2018-06-06 12:07:48.734407+1000 cards[1167:417763] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert 2018-06-06 12:07:49.628057+1000 cards[1167:417772] XPC connection interrupted -> applicationWillResignActive() -> applicationDidEnterBackground() 2018-06-06 12:08:12.858744+1000 cards[1167:417772] TIC Read Status [4:0x1c0363300]: 1:57 2018-06-06 12:08:12.858974+1000 cards[1167:417723] +[CATransaction synchronize] called within transaction 2018-06-06 12:08:12.858988+1000 cards[1167:417772] TIC TCP Conn Failed [5:0x1c0365f40]: 1:50 Err(50) 2018-06-06 12:08:12.859145+1000 cards[1167:417723] +[CATransaction synchronize] called within transaction 2018-06-06 12:08:12.859296+1000 cards[1167:417723] +[CATransaction synchronize] called within transaction -> applicationWillEnterForeground() 2018-06-06 12:08:12.860831+1000 cards[1167:417772] Task <906B3598-CDA6-44FB-A2A7-8E867E18C59A>.<0> HTTP load failed (error code: -1009 [1:50]) 2018-06-06 12:08:12.861170+1000 cards[1167:417772] Task <632FDFEC-ECDC-409D-9606-21EB9EECF6B3>.<0> HTTP load failed (error code: -1005 [4:-4]) 2018-06-06 12:08:12.861215+1000 cards[1167:418365] NSURLConnection finished with error - code -1009 2018-06-06 12:08:12.863325+1000 cards[1167:418365] NSURLConnection finished with error - code -1005 -> applicationDidBecomeActive() Unknown Error UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:LogError(Object) UnityGoogleDrive.AuthCodeExchanger:HandleRequestComplete(AsyncOperation) System.Action`1:Invoke(T) UnityEngine.AsyncOperation:InvokeCompletionEvent()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

UnityGoogleDrive: Failed to exchange authorization code. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:LogError(Object) UnityGoogleDrive.LoopbackAccessTokenProvider:HandleAuthCodeExchanged(AuthCodeExchanger) System.Action1:Invoke(T) UnityGoogleDrive.AuthCodeExchanger:HandleExchangeComplete(Boolean) UnityGoogleDrive.AuthCodeExchanger:HandleRequestComplete(AsyncOperation) System.Action1:Invoke(T) UnityEngine.AsyncOperation:InvokeCompletionEvent()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

UnityGoogleDrive: Failed to execute authorization procedure. Check application settings and credentials. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:LogError(Object) UnityGoogleDrive.AuthController:HandleAccessTokenProviderDone(IAccessTokenProvider) System.Action1:Invoke(T) UnityGoogleDrive.LoopbackAccessTokenProvider:HandleProvideAccessTokenComplete(Boolean) UnityGoogleDrive.LoopbackAccessTokenProvider:HandleAuthCodeExchanged(AuthCodeExchanger) System.Action1:Invoke(T) UnityGoogleDrive.AuthCodeExchanger:HandleExchangeComplete(Boolean) UnityGoogleDrive.AuthCodeExchanger:HandleRequestComplete(AsyncOperation) System.Action`1:Invoke(T) UnityEngine.AsyncOperation:InvokeCompletionEvent()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

`

elringus commented 6 years ago

Which Unity version are you using? Also, please try to change the loopback URI (in the GoogleDriveSettings asset) to http://127.0.0.1 (don't forget to also whitelist it in the console app) and add plist based on this message: https://forum.unity.com/threads/google-drive-sdk-for-unity-free-open-sourced.515360/#post-3426567

elringus commented 6 years ago

And just to be sure, before trying the above, check if the auth credentials in the GoogleDriveSettings are correct (try to parse them again from the json) and delete cached auth tokens in the build via GoogleDriveSettings.DeleteCachedAuthTokens().

josephnarai commented 6 years ago

running 2017.4.1 Unity

josephnarai commented 6 years ago

With regard to the auth credentials, it's working on PC and Android just fine ... do you still suggest I delete the cached Auth Tokens?

We have completely uninstalled the App from the device - this then forces a reauthorisation... and are still getting the issue.

We shall try the whitelist and plist settings as you suggest and let you know.

elringus commented 6 years ago

One more question: you've mentioned that you've tried running under 4.6 backend and that caused other issues, but was the auth working at the same time?

josephnarai commented 6 years ago

It was still working on PC and Android, but on iOS all touch stopped working, so we could not test it at all :(

elringus commented 6 years ago

I've modified the loopback provider so it'll work async even on .NET 2.0. Can you please check whether that has any effect on the issue?

josephnarai commented 6 years ago

great - will try it out and let you know! Thanks.

josephnarai commented 6 years ago

This version is crashing at the end of a transfer or at the begining or a new one: ArgumentNullException: Argument cannot be null. Parameter name: _unity_self at (wrapper managed-to-native) UnityEngine.Networking.UnityWebRequest:Abort () at UnityGoogleDrive.GoogleDriveRequest1[TResponse].SendWebRequest () [0x0001a] in D:\Dev\BitBucket\storycards-prototype\StoryCardsPrototype\Assets\UnityGoogleDrive\Runtime\GoogleDriveRequest.cs:221 at UnityGoogleDrive.GoogleDriveResumableUploadRequest1[TRequest].SendWebRequest () [0x0000d] in D:\Dev\BitBucket\storycards-prototype\StoryCardsPrototype\Assets\UnityGoogleDrive\Runtime\GoogleDriveResumableUploadRequest.cs:58 at UnityGoogleDrive.GoogleDriveRequest`1[TResponse].HandleAccessTokenRefreshed (Boolean success) [0x0001e] in D:\Dev\BitBucket\storycards-prototype\StoryCardsPrototype\Assets\UnityGoogleDrive\Runtime\GoogleDriveRequest.cs:262 at UnityGoogleDrive.AuthController.HandleAccessTokenProviderDone (IAccessTokenProvider provider) [0x0003e] in D:\Dev\BitBucket\storycards-prototype\StoryCardsPrototype\Assets\UnityGoogleDrive\Runtime\Authorization\AuthController.cs:57 at UnityGoogleDrive.LoopbackAccessTokenProvider.HandleProvideAccessTokenComplete (Boolean error) [0x00021] in D:\Dev\BitBucket\storycards-prototype\StoryCardsPrototype\Assets\UnityGoogleDrive\Runtime\Authorization\LoopbackAccessTokenProvider.cs:59 at UnityGoogleDrive.LoopbackAccessTokenProvider.HandleAccessTokenRefreshed (UnityGoogleDrive.AccessTokenRefresher refresher) [0x0006c] in D:\Dev\BitBucket\storycards-prototype\StoryCardsPrototype\Assets\UnityGoogleDrive\Runtime\Authorization\LoopbackAccessTokenProvider.cs:78 at UnityGoogleDrive.AccessTokenRefresher.HandleRefreshComplete (Boolean error) [0x00021] in D:\Dev\BitBucket\storycards-prototype\StoryCardsPrototype\Assets\UnityGoogleDrive\Runtime\Authorization\AccessTokenRefresher.cs:55 at UnityGoogleDrive.AccessTokenRefresher.HandleRequestComplete (UnityEngine.AsyncOperation requestYeild) [0x0008f] in D:\Dev\BitBucket\storycards-prototype\StoryCardsPrototype\Assets\UnityGoogleDrive\Runtime\Authorization\AccessTokenRefresher.cs:75 at UnityEngine.AsyncOperation.InvokeCompletionEvent () [0x00000] in :0

(Filename: D:/Dev/BitBucket/storycards-prototype/StoryCardsPrototype/Assets/UnityGoogleDrive/Runtime/GoogleDriveRequest.cs Line: 221)

elringus commented 6 years ago

Transfer you mean upload/download? I've only changed the loopback auth flow, nothing else. If the auth is working fine now, we probably should close this issue.

josephnarai commented 6 years ago

I don't have the iOS system here. I'm waiting for my partner to test. I will advise as soon as I know if the issue is resolved - but I didn't see this crash until I updated to this new version.

elringus commented 6 years ago

Looks like it's a Unity internal nullef issue happening here: https://github.com/Elringus/UnityGoogleDrive/blob/master/Assets/UnityGoogleDrive/Runtime/GoogleDriveRequest.cs#L219

WebRequest is not null when starting the send operation (could it be you're reusing the same request instance?), so we're attempting to abort and dispose it, but the pointer to actual request instance seems to be not valid on the C++ side.

elringus commented 6 years ago

I've made a change to explicitly null the WebRequest on completion. Maybe this will help to prevent the issue.

josephnarai commented 6 years ago

I tried downloading the package - but it's saying there are no changed? Does the package need to be rebuilt?

elringus commented 6 years ago

One file has changed. I've linked the commit summary in the previous message.

elringus commented 6 years ago

Oh, are you downloading the unity packages from the releases page? I'm not changing those. Please directly pull the repository to get the latest changes.

josephnarai commented 6 years ago

Ah - ok I thought you were updating the package - seems to have worked previously!

josephnarai commented 6 years ago

I didn't clone the repo - thought I could just download the zip and copy the files out - but the file structure in the zip seems to be very different to the repo? I'm confused, can I not just download the zip of the repo?

josephnarai commented 6 years ago

nevermind - I tried downloading the zip again and it worked as expected

elringus commented 6 years ago

In the zip you'll get the entire Unity project. You can just extract the Assets/UnityGoogleDrive folder to get only the essential files, that are bundled with the released packages.

josephnarai commented 6 years ago

I've done that. So far the null reference exception has not reoccurred :)

It's 11pm here in Sydney, so my partner won't get a chance to test with iOS until tomorrow morning. I'll report back as soon as I have information.

Thanks again for the great support. Much appreciated.

adamsingle commented 6 years ago

I'm having a similar problem, except I have no errors. Authentication on the iPad just never switches applications to a browser. Everything is working on desktop. I've updated to the latest code. I've added the plist entries. I have 127.0.0.1 as the loopback uri and have it whitelisted in the app console. But I never see an error. It just looks like the process never gets to the point of kicking off the Application.OpenURL that should trigger the browser to come in. I'm completely stumped. We had it working about 2 days ago, but then good old mac forced a xcode/ios update on us and it all stopped. Any advice would be hugely appreciated

adamsingle commented 6 years ago

I tell a lie. There was an error showing up in xcode, but not in the Unity Log.

2018-06-07 11:03:50.925900+1000 ewp[624:296041] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert 2018-06-07 11:03:50.926076+1000 ewp[624:296041] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert

looks to be the same that josephnarai was/is seeing

elringus commented 6 years ago

@adamsingle just to make sure: you've tried the latest code from the repository (by pulling or downloading a zip), not from one of the packages downloaded via the releases page or readme?

elringus commented 6 years ago

And please specify which Unity version and .NET backend you're using. If it's possible, please try using .NET 4.6 and latest Unity version (2018.1 or 2018.2 beta).

josephnarai commented 6 years ago

I downloaded the zip - we are running in 2017.4 (can't go to 2018, it breaks other code for us) - we are testing iOS now

adamsingle commented 6 years ago

I'm using the latest code from the repo. I am using .NET 4.6. I can't use the latest version of Unity at this point however. We are using 2017.4f1. This project is for a client and we're on version lockdown unless I can make a strong case for upgrading. The issue is we have a process to retest a lot of functionality when we upgrade Unity versions. Is that likely to be an issue? Interesting that @josephnarai is using the same version as I am and having the issue too.

josephnarai commented 6 years ago

We are seeing the same result as adamsingle: 2018-06-07 16:30:43.739949+1000 cards[1397:929778] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert

we can NOT use 4.6 as it completely breaks touch input on iOS

elringus commented 6 years ago

Thanks for the info. One more question: you've mentioned a forced update, was it for the iOS 12?

josephnarai commented 6 years ago

So, I just checked, and XCode was udated for us on May 30 -- and we last tested our iOS implementation before then and it was working - so I would say it's likely that the update to Xcode has broken this.

Also, our current build does the same as adamsingle in that it no longer prompts the user at all... just a blank screen and that error in the log.

josephnarai commented 6 years ago

We could try 2018.1 - as a test, but if it's xcode related do you think that will help ?

elringus commented 6 years ago

Well, trying 2018.1 won't be absolutely useless, but chances are not high, I guess.

josephnarai commented 6 years ago

ok - is there anything else you would like us to try?

elringus commented 6 years ago

@josephnarai @adamsingle can you please provide the full logs of the ones you've posted earlier? The stuff about "BoringSSL" isn't actually useful, the real issue should be somewhere below that message.

josephnarai commented 6 years ago

There isn't any more!

"StartSyncFiles Down:True UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) GoogleDrive:StartSyncFiles(Boolean, String) GoogleDrive:OnGoogleDownButtonClickHandler() UnityEngine.Events.UnityAction:Invoke() UnityEngine.Events.InvokableCall:Invoke() UnityEngine.Events.UnityEvent:Invoke() UnityEngine.UI.Button:Press() UnityEngine.UI.Button:OnPointerClick(PointerEventData) UnityEngine.EventSystems.ExecuteEvents:Execute(IPointerClickHandler, BaseEventData) UnityEngine.EventSystems.EventFunction1:Invoke(T1, BaseEventData) UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents() UnityEngine.EventSystems.StandaloneInputModule:Process() UnityEngine.EventSystems.EventSystem:Update()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

2018-06-07 16:47:17.805654+1000 cards[1414:936183] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert"`

josephnarai commented 6 years ago

That's the log when we try and initiate a download "StartSyncFiles Down: True" is the start

elringus commented 6 years ago

I think I've found the issue: a part of the auth request uri string could've been not escaped properly and looks like on some platforms that worked somehow, while iOS just silently fails when invoking Application.OpenUrl with a malformed uri. Please try the latest code (via a direct pull or downloading a zip).

josephnarai commented 6 years ago

Testing now

josephnarai commented 6 years ago

OK --- so it got to the authentication page this time. But still not working:

StartSyncFiles Down:True UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) GoogleDrive:StartSyncFiles(Boolean, String) GoogleDrive:OnGoogleDownButtonClickHandler() UnityEngine.Events.UnityAction:Invoke() UnityEngine.Events.InvokableCall:Invoke() UnityEngine.Events.UnityEvent:Invoke() UnityEngine.UI.Button:Press() UnityEngine.UI.Button:OnPointerClick(PointerEventData) UnityEngine.EventSystems.ExecuteEvents:Execute(IPointerClickHandler, BaseEventData) UnityEngine.EventSystems.EventFunction1:Invoke(T1, BaseEventData) UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction1) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents() UnityEngine.EventSystems.StandaloneInputModule:Process() UnityEngine.EventSystems.EventSystem:Update()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

MissingMethodException: Method not found: 'Default constructor not found...ctor() of System.ComponentModel.TypeConverter'. at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in :0 at System.Activator.CreateInstance (System.Type type) [0x00000] in :0 at System.ComponentModel.TypeDescriptor.GetConverter (System.Type type) [0x00000] in :0 at Newtonsoft.Json.Serialization.JsonTypeReflector.GetTypeConverter (System.Type type) [0x00000] in :0 at Newtonsoft.Json.Utilities.ConvertUtils.GetConverter (System.Type t) [0x00000] in :0 at Newtonsoft.Json.Serialization.DefaultContractResolver.CanConvertToString (System.Type type) [0x00000] in :0 at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract (System.Type objectType) [0x00000] in :0 at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract (System.Type type) [0x00000] in :0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.GetContractSafe (System.Type type) [0x00000] in :0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) [0x00000] in :0 at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in :0 at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in :0 at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in :0 at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in :0 at UnityGoogleDrive.JsonUtils.FromJsonPrivateCamel[T] (System.String json) [0x00000] in :0 at UnityGoogleDrive.GoogleDriveRequest1[TResponse].HandleResponseData (UnityEngine.Networking.DownloadHandler downloadHandler) [0x00000] in <filename unknown>:0 at UnityGoogleDrive.GoogleDriveRequest1[TResponse].HandleWebRequestDone (UnityEngine.AsyncOperation requestYeild) [0x00000] in :0 at System.Action`1[T].Invoke (.T obj) [0x00000] in :0 at UnityEngine.AsyncOperation.InvokeCompletionEvent () [0x00000] in :0

(Filename: currently not available on il2cpp Line: -1)

2018-06-07 17:24:43.055748+1000 cards[1448:950928] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert

josephnarai commented 6 years ago

Retrying yields this:

StartSyncFiles Down:True UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object) UnityEngine.Debug:Log(Object) GoogleDrive:StartSyncFiles(Boolean, String) GoogleDrive:OnGoogleDownButtonClickHandler() UnityEngine.Events.UnityAction:Invoke() UnityEngine.Events.InvokableCall:Invoke() UnityEngine.Events.UnityEvent:Invoke() UnityEngine.UI.Button:Press() UnityEngine.UI.Button:OnPointerClick(PointerEventData) UnityEngine.EventSystems.ExecuteEvents:Execute(IPointerClickHandler, BaseEventData) UnityEngine.EventSystems.EventFunction1:Invoke(T1, BaseEventData) UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction1) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents() UnityEngine.EventSystems.StandaloneInputModule:Process() UnityEngine.EventSystems.EventSystem:Update()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

MissingMethodException: Method not found: 'Default constructor not found...ctor() of System.ComponentModel.TypeConverter'. at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in :0 at System.Activator.CreateInstance (System.Type type) [0x00000] in :0 at System.ComponentModel.TypeDescriptor.GetConverter (System.Type type) [0x00000] in :0 at Newtonsoft.Json.Serialization.JsonTypeReflector.GetTypeConverter (System.Type type) [0x00000] in :0 at Newtonsoft.Json.Utilities.ConvertUtils.GetConverter (System.Type t) [0x00000] in :0 at Newtonsoft.Json.Serialization.DefaultContractResolver.CanConvertToString (System.Type type) [0x00000] in :0 at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract (System.Type objectType) [0x00000] in :0 at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract (System.Type type) [0x00000] in :0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.GetContractSafe (System.Type type) [0x00000] in :0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, Boolean checkAdditionalContent) [0x00000] in :0 at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in :0 at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in :0 at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in :0 at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in :0 at UnityGoogleDrive.JsonUtils.FromJsonPrivateCamel[T] (System.String json) [0x00000] in :0 at UnityGoogleDrive.GoogleDriveRequest1[TResponse].HandleResponseData (UnityEngine.Networking.DownloadHandler downloadHandler) [0x00000] in <filename unknown>:0 at UnityGoogleDrive.GoogleDriveRequest1[TResponse].HandleWebRequestDone (UnityEngine.AsyncOperation requestYeild) [0x00000] in :0 at System.Action`1[T].Invoke (.T obj) [0x00000] in :0 at UnityEngine.AsyncOperation.InvokeCompletionEvent () [0x00000] in :0

(Filename: currently not available on il2cpp Line: -1)

josephnarai commented 6 years ago

But it's no longer prompting to authenticate (after the first one)

elringus commented 6 years ago

Make sure you've set scripting backend to .NET 2.0 (not subset), the third party JSON library is not working with the subset, unfortunately.

josephnarai commented 6 years ago

Oh, we have had it set to subset always -- so is this iOS specific?

elringus commented 6 years ago

It affects only the AOT platforms, I believe.

josephnarai commented 6 years ago

switching "subset" off fixed it! I'm not sure what other impact that might have on the project - we shall do some more testing, but it appears we are working again!

Thanks!

elringus commented 6 years ago

.NET 2.0 subset is just, well, a subset of .NET 2.0 APIs used to reduce the build size. You'll win about 1-2 MB off the build size using it, but it will also strip a lot of APIs. So when you switch to the full profile, nothing could possibly break, you'll just get a slightly larger build.

elringus commented 6 years ago

I've published a new release with all the fixes. Feel free to reply to this issue in case something still won't work regarding the auth on iOS.

mohsinkhan26 commented 5 years ago

This issue is still there and causing this issue!

Check this and this for details!

The Xcode logs are


UnityGoogleDrive: OAuth authorization error: Error: The operation couldn’t be completed. (org.openid.appauth.general error -3.). UnityGoogleDrive.IOSAccessTokenProvider:HandleAuthorizationResponse(String) System.Action1:Invoke(T)

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

UnityGoogleDrive: Failed to execute authorization procedure. Check application settings and credentials. UnityGoogleDrive.AuthController:HandleAccessTokenProviderDone(IAccessTokenProvider) System.Action1:Invoke(T) System.Action1:Invoke(T)

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

NullReferenceException: Object reference not set to an instance of an object. at Game.ImageUpload.OnSendRequestDone (UnityGoogleDrive.Data.File _file) [0x00000] in <00000000000000000000000000000000>:0 at System.Action1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0 at UnityGoogleDrive.GoogleDriveRequestYieldInstruction1[TResponse].HandleRequestDone (TResponse responseData) [0x00000] in <00000000000000000000000000000000>:0 at System.Action1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0 at UnityGoogleDrive.GoogleDriveRequest1[TResponse].CompleteRequest () [0x00000] in <00000000000000000000000000000000>:0 at System.Action1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0 at System.Action1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0 at System.Action`1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0

(Filename: currently not available on il2cpp Line: -1)`


The popup to sign-in comes but before I can click to sign-in, it goes away and the above errors are shown in logs

Any help!

mrSeoD commented 4 years ago

Hi @Elringus, I am getting the same error as @mohsinkhan26:

UnityGoogleDrive: OAuth authorization error: Error: The operation couldn’t be completed. (org.openid.appauth.general error -3.).

I would appreciate if you could help us with this error!