1
votes

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 :)

2

2 Answers

4
votes

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

0
votes

The last version officially supported by AirConsole is 2018.2.11 (see the asset store download page under "supported versions") , seeing you are running 2018.3.x this may cause versioning errors.

Importing the asset in Unity 2017.3.0 yielded no errors, so downgrading to the latest officially supported version should do the trick.

If however you want to stick to Unity 2018.3 You'll have to either wait for support from the developers, or you can try updating your Newtonsoft.Json library to the newest verion.

To update you need to download Newtonsoft.Json with NuGet using PM> Install-Package Newtonsoft.Json -Version 12.0.1 inside the NuGet package manager, and overwrite the version that is inside Assets\AirConsole\Plugins. NuGet page.

Updating the Newtonsoft version rid me of the errors you posted above in 2018.3 but i have not tested it thoroughly, so cannot guarantee that it'll work 100%.