JoshLmao / Spotify4Unity

🎮🎵 Add the SpotifyAPI.NET library into Unity, enabling access to the Spotify Web API, allowing for control of Spotify and accessing the world of music
https://assetstore.unity.com/packages/tools/integration/spotify4unity-ui-tools-spotify-authorization-129028
MIT License
94 stars 8 forks source link

Android Support: Mono io layer error #42

Open SolidJuho opened 3 years ago

SolidJuho commented 3 years ago

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 commented 3 years ago

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?

JoshLmao commented 3 years ago

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