Search Unity

Unity Analytics WebGL compiler error

Discussion in 'Unity Analytics' started by felipeerpk, Oct 22, 2015.

  1. felipeerpk

    felipeerpk

    Joined:
    Apr 9, 2013
    Posts:
    6
    Hi,

    I'm trying to integrate Unity Analytics on my project. I have successfully integrated it on Android and iOS, but when I switch to WebGL I get a compiler error:

    Assets/Plugins/UnityAnalytics/WebGLWrapper.cs(4,39): error CS0246: The type or namespace name `BasePlatformWrapper' could not be found. Are you missing a using directive or an assembly reference?

    The issue is that in the PlatformWrapper.cs there is a precompilation check with the unity versions, but it doesn't have the UNITY_5_2 check. It's like this:

    Code (CSharp):
    1. #if(UNITY_IPHONE||UNITY_ANDROID||UNITY_STANDALONE||UNITY_WEBPLAYER||UNITY_WEBGL||UNITY_METRO)&&(UNITY_4_2||UNITY_4_3||UNITY_4_4||UNITY_4_5||UNITY_4_6||UNITY_4_7||UNITY_4_8||UNITY_4_9||UNITY_5_0||UNITY_5_1)
    where it should be:

    Code (CSharp):
    1. #if(UNITY_IPHONE||UNITY_ANDROID||UNITY_STANDALONE||UNITY_WEBPLAYER||UNITY_WEBGL||UNITY_METRO)&&(UNITY_4_2||UNITY_4_3||UNITY_4_4||UNITY_4_5||UNITY_4_6||UNITY_4_7||UNITY_4_8||UNITY_4_9||UNITY_5_0||UNITY_5_1||UNITY_5_2)
    I'm using Unity 5.2.0f3 with the latest Unity Analytics 1.9.5 (downloaded from the Asset Store).

    Is anyone more having this issue? Is there a side effect if I fix the error changing the PlatformWrapper.cs class.

    Thanks in advance,
     
  2. mpinol

    mpinol

    Joined:
    Jul 29, 2015
    Posts:
    317
    Hi @felipeerpk,

    The 1.9.5 SDK was only intended to be used up to Unity version 5.1 so it has not been tested on 5.2. For versions 5.2 and above, Analytics is now integrated directly into the editor. Can you try reintegrating with the editor integrated version of Analytics and see if that resolves your issue? Here is a link with some information about reintegrating, http://forum.unity3d.com/threads/upgrade-unity-analytics-5-1-to-5-2.352175/

    If you are still having trouble after the reintegration you can open a support ticket here, https://analytics.cloud.unity3d.com/support and we will see if we can resolve this for you.
     
  3. felipeerpk

    felipeerpk

    Joined:
    Apr 9, 2013
    Posts:
    6
    Hi @mpinol,

    Reintegrating Unity Analytics with the editor version solves the issue! It now works for all the platforms (iOS, Android and WebGL).

    Thanks a lot,
     
    mpinol likes this.