Here is some additional information. UCB publishes an apk but the log shows some errors. These errors do not occur in the local build:
1489: [Unity] Compilation failed: 6 error(s), 2 warnings
1490: [Unity] Assets/Scripts/TrackableEventHandler.cs(140,3): error CS0246: The type or namespace name AnalyticsLogger' could not be found. Are you missing an assembly reference? 1491: [Unity] Assets/Scripts/TrackableEventHandler.cs(142,7): error CS0841: A local variable
logger’ cannot be used before it is declared
1492: [Unity] Assets/Scripts/TrackableEventHandler.cs(143,4): error CS0841: A local variable logger' cannot be used before it is declared 1493: [Unity] Assets/Vuforia/Scripts/DefaultTrackableEventHandler.cs(136,4): error CS0246: The type or namespace name
AnalyticsLogger’ could not be found. Are you missing an assembly reference?
1494: [Unity] Assets/Vuforia/Scripts/DefaultTrackableEventHandler.cs(138,8): error CS0841: A local variable logger' cannot be used before it is declared 1495: [Unity] Assets/Vuforia/Scripts/DefaultTrackableEventHandler.cs(139,5): error CS0841: A local variable
logger’ cannot be used before it is declared
The variable “logger” is an instance of a custom component. Here is the code that is flagging the error:
138: private void LogAnalytics()
139: {
140: AnalyticsLogger logger = GetComponent ();
141:
142: if (logger != null) {
143: logger.Log ();
144: }
145: }
There is no “using” necessary for the AnalyticsLogger class because it is not namespaced. Here is that class:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Analytics;
public class AnalyticsLogger : MonoBehaviour {
public string m_eventType;
public string m_eventName;
public void Log() {
Analytics.CustomEvent(m_eventType, new Dictionary<string, object>
{
{ “item.name”, m_eventName },
{ “app.name”, Application.productName },
{ “device.language”, Application.systemLanguage },
{ “device.model”, SystemInfo.deviceModel },
{ “device.id”, SystemInfo.deviceUniqueIdentifier },
{ “device.platform”, Application.platform },
{ “device.os”, SystemInfo.operatingSystem }
});
}
}
There are no errors in the Unity Editor and the app compiles and behaves correctly. The Analytics validator in the Editor shows the analytics events coming through correctly. Is UCB generating false errors? Is it okay to ignore them?