Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity Cloud build fail because unity analytics

Discussion in 'Unity Build Automation' started by jurangov, Sep 15, 2015.

  1. jurangov

    jurangov

    Joined:
    Jul 22, 2012
    Posts:
    4
    I´m trying to make a build from unity cloud build for iOS and Android and it fail with this error:

    The name `Analytics' does not exist in the current context.

    But the UnityEngine.Analytics has been added to the script and the Analytics option is ON, also the project compile fine in editor.



    Thanks in advance for the help.
     
  2. patrickc

    patrickc

    Unity Technologies

    Joined:
    Jan 23, 2015
    Posts:
    67
    jurangov,

    Make sure that your project in Cloud Build is setup to use the same version of Unity that you're using on your computer. Cloud Build supports dozens of different Unity versions, and for things like Analytics, it's important that your editor and Cloud Build are using the same one.

    I hope that helps.

    Cheers,
    Patrick
     
  3. jurangov

    jurangov

    Joined:
    Jul 22, 2012
    Posts:
    4
    Hi patrickc,

    I just checked, and change the unity version build option from Latest 5.x to the specific 5.2.0f3, and i have the exact same version, but the cloud build keep failing with the same compilation error.
     

    Attached Files:

  4. patrickc

    patrickc

    Unity Technologies

    Joined:
    Jan 23, 2015
    Posts:
    67
    jurangov,

    Can you direct message me a link to your project in Cloud Build?

    Thanks,
    Patrick
     
  5. patrickc

    patrickc

    Unity Technologies

    Joined:
    Jan 23, 2015
    Posts:
    67
    Also, does this project compile for iOS and Android when you switch your local editor to these platforms? If you're developing in Standalone/Desktop (Win/Mac/Linux) mode, you won't see the same errors as when you tell the editor to specifically build for iOS or Android. In Unity, go to File -> Build Settings, then select iOS and click the "Switch Platform" button.

    Cheers,
    Patrick
     
  6. jurangov

    jurangov

    Joined:
    Jul 22, 2012
    Posts:
    4
    yeah in my local editor i´m building with the desire platforms iOS and Android
     
  7. IndieForger

    IndieForger

    Joined:
    Dec 31, 2012
    Posts:
    92
    I have the same problem. this is highly annoying....

    Code (CSharp):
    1. The name `Analytics' does not exist in the current context
    Problem occurred after upgrading from 5.1 to 5.2. Unity doesn't seem to see the UnityEngine.Analytics namespace.

    On the top of the file I have

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Analytics;
    I noticed that even auto completion stopped working when I type
    UnityEngine. and wait for the popup with all namespaces Analytics is not there as it used to be before the upgrade
     
  8. Evgeny-Eliseev

    Evgeny-Eliseev

    Joined:
    Jan 21, 2015
    Posts:
    19
    I started use analytics from 5.2 and cloud build just stoped compile my build with same error.

    Code (CSharp):
    1. The name `Analytics' does not exist in the current context
    Local build is ok.
     
  9. patrickc

    patrickc

    Unity Technologies

    Joined:
    Jan 23, 2015
    Posts:
    67
    We're looking into this. Thanks for letting us know.

    Cheers,
    Patrick
     
  10. Evgeny-Eliseev

    Evgeny-Eliseev

    Joined:
    Jan 21, 2015
    Posts:
    19
    In my case, I forgot commit UnityAnalyticsManager.asset...

    File -> Save Project (>.<)

    Sorry
     
  11. JeanPierre_Bailly

    JeanPierre_Bailly

    Joined:
    Nov 2, 2015
    Posts:
    10
    I'm using both Unity Analytics and Unity Cloud Build.

    For few days, all my iOS build on UCB failed because of this error :

    I'm calling the Analytics.CustomEvent method in a analytics-dedicated class which use "UnityEngine.Analytics;"

    Everything is allright on my android build.

    Do you have any ideas for making my iOS build successfully again on UCB ?
     
  12. unitychrism

    unitychrism

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    122
    @JeanPierre_Bailly Can you direct message me a link to the project in Cloud Build where you're seeing this? Are your Android/iOS builds based on the same code repository?