Editor Build apk works; Cloud Build apk doesn't

I have an app that uses Vuforia. I am using the Unity Editor on Windows 10 and building for Android.

When I build locally in the editor, my apk is 28K and works great on the Android devices that I have tested.

The Cloud Build apk is 18K and doesn’t work on Android devices. It shows a black screen with distorted white bars on the very edge of the screen.

Why are the two builds so different? Is there something that I need to do to allow Vuforia apps in Cloud Build?

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?

From my experience, UCB launches the Unity editor several times before actually building your project. These may be “transient” errors from one of these launches. Not sure though… it could be a bug in UCB.

The important thing is that the build completes successfully and does not generate any errors from the build.

You can open both APKs (local one vs. UCB) and compare their contents).

What Android “Build System” are you using in the Editor? If you have “Gradle (New)” selected, UCB doesn’t support that: Using Gradle Build System with Cloud Build - Unity Services - Unity Discussions

I am using “Internal (Default)”.