Search Issue Tracker

Fixed in 2020.1.X

Fixed in 2018.4.X, 2019.2.X, 2019.3.X

Votes

39

Found in

2018.4.1f1

2018.4.3f1

Issue ID

1167025

Regression

Yes

[iOS] Batchmode builds fail with CloudDiagnostics enabled when USYM_UPLOAD_AUTH_TOKEN is not set

Cloud Diagnostics

-

Internal repro:
./utr.pl --suite=integration --testtarget=iOS --testfilter=Unity.IntegrationTests.CrashReporting.CrashReportingBuildsTest.CanBuildiOS
The test enables CloudDiagnostics and performs a batchmode build. The resultant Xcode project won't compile with the error:
Please provide an auth token with USYM_UPLOAD_AUTH_TOKEN environment variable.

Compiling the Xcode project by passing the env variable to xcodebuild process results in a successful build:
USYM_UPLOAD_AUTH_TOKEN=test xcodebuild build <projectPath>

To reproduce:

1. Download attached "Project.zip" project and open in Unity
2. Change the platform to iOS
3. Enable Cloud Diagnostics
4. Close Unity Editor
5. Build in BatchMode with Arguments:

<Unity Path> -batchmode -buildTarget iOS -runTests -testplatform playmode -projectpath <PATH> -executeMethod BuildScript.UnityBuildTest -username <Your Unity ID> -password <Password of your Unity ID> -quit

6. When Build complete, open Xcode project
7. In Menu bar press Product > Build

Expected result: Xcode successfully Builds Project
Actual result: Xcode fails to Build Project and throws Error:

"Please provide an auth token with USYM_UPLOAD_AUTH_TOKEN environment variable"

Notes:
- This issue happens only on iOS
- If You Build directly from Unity Editor, everything works as Expected
- If You Build without "-runTests -testplatform playmode" or with Cloud Diagnostics disabled, the Build in Xcode completes without any issues
- The Project and a Video how to reproduce this issue are attached in Comments section
- There are few Forum links to this issue:
https://forum.unity.com/threads/ios-build-issues-should-be-resolved-and-unity-2019-1-4f1-now-available.687163/
https://forum.unity.com/threads/unity-2018-4-1f1-lts-batch-build-for-ios-is-not-working.690103/
https://forum.unity.com/threads/unity-2018-4-1f1-lts-batchmode-for-ios-is-not-working.693010/

Reproduced on Unity 2018.4.1f1, 2018.4.3f1, 2019.1.9f1, 2019.2.0b8 and 2019.3.0a8
Not reproduced on Unity 2018.4.0f1
Regression on Unity 2018.4.1f1

Comments (33)

  1. mcarriere

    May 20, 2020 12:21

    This is still occurring on 2019.3.14f1 -- we typically use jenkins for CI, but can even get this to reproduce if we simply run it as the main user on system.

  2. yangskybox

    May 07, 2020 16:17

    I just tested 2019.3.13f1 and I don't believe this is fixed? Does "fixed" mean "provide credentials on commandline so it's able to generate token" or "a way exist to leave Cloud Diagnostics ON but without uploading debug symbols".

    What revision was this actually fixed in?

    We're still having to disable crash reporting entirely or giving Unity an invalid token to work around htis.

  3. xiaoguangxing

    Nov 07, 2019 06:41

    Reproduced on Unity 2018.4.12f1

  4. jackatfp

    Sep 13, 2019 20:45

    Just tried to make a build on Unity 2019.2.5f1. Still had the same error.

    level=fatal msg="Please provide an auth token with USYM_UPLOAD_AUTH_TOKEN environment variable"
    Command PhaseScriptExecution failed with a nonzero exit code

  5. stayasquad

    Aug 20, 2019 08:50

    similar behaviour in 2019.2.0f1

  6. ylen_sami

    Aug 14, 2019 15:03

    Reproduced in 2019.1.14f1 as well.

  7. Bonich

    Aug 09, 2019 06:49

    In teamcity we can fix it, by patching process_symbols.sh in xcode project.

    Just change strings with usymtool on something like there:

    #!/bin/sh

    # process_symbols
    #
    # Copyright (c) 2015 Unity Technologies. All rights reserved.

    if [ "${SYNCHRONOUS_SYMBOL_PROCESSING}" = "TRUE" ]; then

    echo test

    else
    nohup "$PROJECT_DIR/usymtool" -symbolPath "$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME" > /dev/null 2>&1 &
    disown
    fi

  8. vizgl

    Aug 06, 2019 20:59

    Unity 2019.1.13f1
    same

  9. ThatOdieGuy

    Jul 31, 2019 03:31

    I was able to resolve this by adding -username and -password arguments.

    Info found here:
    https://forum.unity.com/threads/upload-symbols-to-cloud-diagnostics-when-building-from-command-line.604780/

    "When using Cloud Diagnostics with -batchmode it's now required that you specify both the -username and -password arguments to avoid the USYM_UPLOAD_AUTH_TOKEN error message."

  10. yanivng

    Jul 28, 2019 07:07

    Did anyone check 2018.4.5f1?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.