Unity Cloud build fail because unity analytics

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.

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

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.

2297347--154590--Screen Shot 2015-09-15 at 9.58.45 PM.png

jurangov,

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

Thanks,
Patrick

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

yeah in my local editor i´m building with the desire platforms iOS and Android

I have the same problem. this is highly annoying…

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

using UnityEngine;
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

I started use analytics from 5.2 and cloud build just stoped compile my build with same error.

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

Local build is ok.

We’re looking into this. Thanks for letting us know.

Cheers,
Patrick

In my case, I forgot commit UnityAnalyticsManager.asset…

File → Save Project (>.<)

Sorry

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 ?

@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?