Spotify4Unity icon indicating copy to clipboard operation
Spotify4Unity copied to clipboard

Android Support: Mono io layer error

Open SolidJuho opened this issue 3 years ago • 2 comments

Example scene working flawlessy on Win10 but on Android 11 there's following error when trying to authenticate.

Exception opening browser for auth: 'System.ComponentModel.Win32Exception (0x80004005): mono-io-layer-error (0)
  at System.Diagnostics.Process.StartWithShellExecuteEx (System.Diagnostics.ProcessStartInfo startInfo) [0x00000] in <00000000000000000000000000000000>:0
   at System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) [0x00000] in <00000000000000000000000000000000>:0
  at PKCE_Authentification+<GetFreshAuth>d__15.MoveNext () [0x00000] in <00000000000000000000000000000000>:0
  at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0
   at PKCE_Authentification.GetFreshAuth () [0x00000] in <00000000000000000000000000000000>:0
  at PKCE_Authentification.StartAuthentification () [0x00000] in <00000000000000000000000000000000>:0
   at UnityEngine.Events.UnityAction.Invoke () [0x00000] in <00000000000000000000000000000000>:0
  at UnityEngine.Events.UnityEvent.Invoke () [0x00000

SolidJuho avatar Jul 05 '21 15:07 SolidJuho

Ah, my bad. Seems like 2.0 currently only supports Win, Linux and Mac. Seems like need to rollback to 1.5. Is there any ETA for mobile support?

SolidJuho avatar Jul 05 '21 18:07 SolidJuho

Hey. As you found, v2 only supports Win Linux and Mac due to a deeper issue from Unity. I'd love to support mobile but the issue at hand is something I'm probably not good enough to fix.

Anyway, the issue is that IL2CPP hasn't implemented the Process class which prevents Process.Start() being called in the current setup. Here is a thread I read a bit ago on the issue with more info. I'd like to try and find a way around this but the issue spreads into SpotifyAPI-NET's EmbedIOAuthServer and the EmbedIO library, which I have no experience with

JoshLmao avatar Jul 05 '21 20:07 JoshLmao