Open yuanchicai opened 4 years ago
There is a system for debugging in Editor using the MobileSpotifyService, info here
Are you building the demo scene onto your android device? Or is it a custom scene? If you could try building the demo scene and see if the error still occurs. If so, a debug message would be a lot more helpful that just a generic "not working". Make sure you've followed the setup instructions for your platform and read the FAQ incase that covers your question
For the editor mode, it works fine. I build it from the mobile demo scene to my android devices. I think is the AUTHENTICATION problem maybe cause by VPN. In the test user's account, my test app already show up in "Apps with access to your Spotify information"
The Error Log:
10-17 11:20:47.160 16989-16989/? E/WebViewLibraryLoader: can't load with relro file; address space not reserved
10-17 11:20:52.232 16914-17029/? E/Unity: Unable to find libc
10-17 11:20:56.260 16914-16929/? E/Unity: PlatformNotSupportedException: Operation is not supported on this platform.
at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDynamicMethod (System.String name, System.Type returnType, System.Type[] parameterTypes, System.Type owner) [0x00018] in
Okay, that's more info. However, it seems like there's two problems. First one being with Newtonsoft.Json having "Platform not supported.". I suggest swapping out Newtonsoft with Json.NET. This step is usually only required for iOS, however it seems like it could fix your problem here. Check out step 7 and step 8 of the iOS setup steps on how to do it
Second seems to be authorization to Google failing. I have no idea how to fix that one. However fixing the above might fix that 🤷♂️
After I fixed the first one, it's working on devices and player panel. But the profiler panel info is missing:
Spotify4Unity - Can't load Private Profile information of authorized user - System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.Dictionary`2+Enumerator[TKey,TValue].MoveNext () [0x00016] in
I have two more questions, can I pause or play songs in my app? And can I just provide several songs as options for my user?
Sorry for the late response. That problem is one that I know about and trying to fix
Hey there!
We're enjoying the functionality of your plugin.
On this bug... This issue does not present itself when build using the mono scripting back end. We have full Spotify control with this build (send & receive data).
However...
This issue is still persisting while building with the following setup: Back end: IL2CPP Architecture: x64
We can send Spotify instructions. But we cannot receive Spotify data (e.g. Track info, Play State...)
Any help would be much appreciated!
Solved: https://github.com/JoshLmao/Spotify4Unity/issues/23#issuecomment-559748577
Hi, the "Unable to find constructor..." is fixable like said above, by using Json.NET. Unless you wish to clone SpotifyAPI.NET and add in the constructors 🤷♂️
However, the NotSupportedException is a new one for me. Is it related to this? Also, which version of Unity are you working in? I'm not too knowledgeable about the Android build process but there are a couple other people who had the same error and had it fixed
When I run in android device, the authorized website pop up successfully and then I press agree, it jump back to my app. But no music information shows up.
It works in editor only if I log in to the spotify account and keep it open, I am not sure why but is working.