The past few days im trying to integrate music streaming services (Spotify and Deezer) in Unity3D.
Starting with the libspotify SDK written in C for Win32:
But with no luck. I have tried different C# wrappers like libspotifydotnet and libspotify-sharp.
But all implementations ends with the same result, which is crashing Unity3D.
The following error occurs when using the libspotify-sharp wrapper (crashing unity):

But the libspotify.dll IS in the /Assets/plugins/ folder (path is also correct in the error message!).
Besides the wrapper, i also tried using the libspotify.dll in /Assets/plugins/ directly by creating a simple C# script which imports the libspotify.dll and mapped two functions with it according to the Unity plugins tutorial with the functions described in the documentation of libspotify like so:
using System;
using System.Runtime.InteropServices;
using UnityEngine;
public class TestSpotify : MonoBehaviour
{
[DllImport ("libspotify")]
public static extern string sp_error_message (sp_error error);
[DllImport ("libspotify")]
internal static extern sp_error sp_session_login (IntPtr sessionPtr, string username, string password);
void Start ()
{
Debug.Log ("result of native lib is : " + sp_error_message (sp_error.OK));
}
#region Enums
public enum sp_error
{
OK = 0,
BAD_API_VERSION = 1,
API_INITIALIZATION_FAILED = 2
}
#endregion
}
Is my approach wrong? (is the libspotify.dll at the wrong location or do i miss some .NET skills and insights?)
because this code also results in the DllNotFoundException.
And who succeeded with implementing the libspotify SDK anyway? because the total amount of information on the internet is like a fart in the wind… so, any unityproject would be very much appreciated :).
I’m using Unity3D pro and MonoDevelop as development environment.