msciotti / discord-game-sdk-test-apps

A repo full of various Discord GameSDK sample apps
67 stars 39 forks source link

Unity: Error when running unity example build with IL2CPP #2

Open ksmit799 opened 5 years ago

ksmit799 commented 5 years ago

I'm getting the following runtime error when running a compiled IL2CPP build using Unity 2018.2.21f1.

NotSupportedException: IL2CPP does not support marshaling delegates that point to instance methods to native code. at System.Runtime.InteropServices.Marshal.StructureToPtr[T] (T structure, System.IntPtr ptr, System.Boolean fDeleteOld) [0x00000] in <00000000000000000000000000000000>:0 at Discord.ActivityManager..ctor (System.IntPtr ptr, System.IntPtr eventsPtr, Discord.ActivityManager+FFIEvents& events) [0x00000] in <00000000000000000000000000000000>:0 at Discord.Discord.GetActivityManager () [0x00000] in <00000000000000000000000000000000>:0 at DiscordController.Start () [0x00000] in <00000000000000000000000000000000>:0

Jump-Suit commented 5 years ago

To give input about the status of this: https://support-dev.discordapp.com/hc/en-us/community/posts/360047757091-Fix-sdk-when-using-Unity-with-il2cpp It is indeed planned!

LoneDev6 commented 3 years ago

They said it's fixed but it's not, I still have this problem even using the latest version provided in their website: https://discord.com/developers/docs/game-sdk/sdk-starter-guide#sdk-starter-guide

EDIT: To fix this you have to download a build they send on their Discord server: https://dl-game-sdk.discordapp.net/3.1.0/discord_game_sdk.zip