discord-game-sdk-test-apps icon indicating copy to clipboard operation
discord-game-sdk-test-apps copied to clipboard

Unity: Error when running unity example build with IL2CPP

Open ksmit799 opened this issue 5 years ago • 2 comments

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

ksmit799 avatar Jul 18 '19 09:07 ksmit799

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!

Jump-Suit avatar Sep 19 '19 18:09 Jump-Suit

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

LoneDev6 avatar Dec 16 '20 18:12 LoneDev6