Search code examples
c#unity-game-engineairconsole

Airconsole & Unity integration issue


First of all i'm new to unity & airconsole both platforms.

I was just exploring unity with airconsole integration but i'm getting errors on importing "airconsole plugin" (imported from Asset Store).

I'm using latest version of unity 2018.3.0f2 Personal on windows 10.

Following are few error messages i can see in unity console

Assets\AirConsole\plugins\Newtonsoft.Json\Utilities\DynamicWrapper.cs(27,20): error CS0246: The type or namespace name 'ModuleBuilder' could not be found (are you missing a using directive or an assembly reference?)

Assets\AirConsole\plugins\Newtonsoft.Json\Utilities\DynamicWrapper.cs(25,20): error CS0246: The type or namespace name 'ModuleBuilder' could not be found (are you missing a using directive or an assembly reference?)

Assets\AirConsole\plugins\Newtonsoft.Json\Utilities\DynamicReflectionDelegateFactory.cs(193,72): error CS0246: The type or namespace name 'ILGenerator' could not be found (are you missing a using directive or an assembly reference?)

Assets\AirConsole\plugins\Newtonsoft.Json\Utilities\DynamicReflectionDelegateFactory.cs(214,81): error CS0246: The type or namespace name 'ILGenerator' could not be found (are you missing a using directive or an assembly reference?)

...........

How can i resolve the issue & test basic airconsole examples. Thanks in advance :)


Solution

  • There is no need to update the Newtonsoft.Json Library. Instead, you can simply set API Compatibility Level to .NET 4.x in Player Settings / WebGL Settings / Other Settings.

    For this to resolve the errors, the Platform (in Build Settings) needs to be set to WebGL, or you have to change the API Compatibility level also for your currently selected Platform in its own Player Settings