Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Firebase Crash Reporting - Error running build script

I get the following error when running the script to upload symbol files (everytime I try and build my project):

upload-sym-util.bash:351: error: symbolFileUploadLocation: The API Key and the authentication credential are from different projects.

Here is my build script:

if [ "$CONFIGURATION" == "Debug" ]; then
    GOOGLE_APP_ID=<app-id>
    "${PODS_ROOT}"/FirebaseCrash/upload-sym "${SRCROOT}"/<app>/Firebase/CrashReportingKey-Dev.json
else
    GOOGLE_APP_ID=<app-id>
    "${PODS_ROOT}"/FirebaseCrash/upload-sym "${SRCROOT}"/<app>/Firebase/CrashReportingKey.json
fi

Things I've done/checked:

  1. The GOOGLE_APP_ID and CrashReportingKey*.json are associated with the same project.
  2. My GoogleService-Info*.plist files have the API_KEY field.
  3. Checking "Run script only when installing" box, which allows me to run the app, but doesn't actually run the script in a development environment. So crashes are sent to Firebase, but they aren't symbolicated.

I'm open to any ideas. Thanks!

like image 261
cohenadair Avatar asked Jan 19 '17 01:01

cohenadair


2 Answers

You are correct that there's no way to override the GoogleService-Info.plist. However there's still a way to override the pieces of information the upload script uses from that file.

  1. Open the GoogleService-Info.plist corresponding to the .json.
  2. Search for GOOGLE_APP_ID and API_KEY.
  3. Adjust the build script like so:

    export FIREBASE_APP_ID=<GOOGLE_APP_ID>
    export FIREBASE_API_KEY=<API_KEY>
    
    "${PODS_ROOT}"/FirebaseCrash/upload-sym "ServiceAccount.json"
    

In your case, your final script should look something like:

    if [ "$CONFIGURATION" == "Debug" ]; then
        export FIREBASE_APP_ID=<app-id>
        export FIREBASE_API_KEY=<API_KEY for dev>
        "${PODS_ROOT}"/FirebaseCrash/upload-sym "${SRCROOT}"/<app>/Firebase/CrashReportingKey-Dev.json
    else
        export FIREBASE_APP_ID=<app-id>
        export FIREBASE_API_KEY=<API_KEY for release>
        "${PODS_ROOT}"/FirebaseCrash/upload-sym "${SRCROOT}"/<app>/Firebase/CrashReportingKey.json
    fi
like image 57
Eric Shieh Avatar answered Nov 17 '22 20:11

Eric Shieh


I resolved :

in terminal : rm $HOME/Library/Preferences/com.google.SymbolUpload*

Xcode : Product -> Clean

like image 7
MinuteFace México Avatar answered Nov 17 '22 20:11

MinuteFace México