First of all, I'm using firebase crashreporting since February. Because of bitcode (for the prod versions), I need to download DSYMs and upload from terminal. It's all ok, but today, I faced that the script that I used not working anymore. I did NOT changed anything, nor in the service account files, nor in the script.
I'm getting a warning, that my service account file is not like a service account file
./Pods/FirebaseCrash/batch-upload /Project/ServiceAccount.json F3B……..5272
./Pods/FirebaseCrash/batch-upload:83: warning: The first argument does not look like a service account file.
./Pods/FirebaseCrash/batch-upload:127: warning: Running extract-keys on desktop.
I used this script previously, which not worked today:
./Pods/FirebaseCrash/batch-upload /ProjectName/Firebase_Crash.json B5CF...8A
And the working one...:
./Pods/FirebaseCrash/batch-upload ./ProjectName/Firebase_Crash.json B5CF...8A
This one also works:
./Pods/FirebaseCrash/batch-upload -i ./ProjectName/Info.plist -p ./ProjectName/GoogleService-Info.plist ./ProjectName/Firebase_Crash.json B5CF...8A
Related
I have an iOS app with a Build phase script that reads a plist file using the following command:
defaults read "/full/path/to/plist/file" CFBundleExecutable
...but it fails with the following error message:
The domain/default pair of (/full/path/to/plist/file.plist, CFBundleExecutable) does not exist
The full path of the file is correct and I double checked that the file indeed contains the key CFBundleExecutable. I also tried with other keys such as CFBundleName. Running the command both with and without .plist at the end of the full path fails.
I also ran the command in Terminal to see if it works generally, but the command fails there as well.
It turns out that macOS (or the defaults command line tool) seems to have a bug. Folders that are "special" such as Documents and Desktop act differently within the command line environment and as such I observed the following:
If Info.plist is located in a subfolder of Desktop or Documents the defaults read command will fail
As soon as you place Info.plist in any other folder (such as a Developer folder) the same defaults read command will succeed
I am not sure if this is due to the fact that both of these folders require special permissions (macOS asks if an app requests access to either of these) or if it is because they are part of iCloud Drive and perhaps there is some weird symlinking in the background.
Either way, if you run into a similar error, just try to place your project in a subfolder of ~/Developer (or any other non-default, non-special folder).
In my iOS project i have some run script files in my directory. When using the new Xcode 9 Server feature "Run test in parallel" the xcodebuild failes because it can not open so many times the same file.
The file to be called is here:
/my-ios-project/scripts/my-script.sh
I call it two times in my run script which was never a problem
"${SOURCE_ROOT}"/scripts/my-script.sh first-call-arg
"${SOURCE_ROOT}"/scripts/my-script.sh second-call-arg
Error message says "fork: Resource temporarily unavailable". As far as i know this is because it tries to open one file too many times.
/bin/sh -c \"/Users/xcodeserver/Library/Caches/XCSBuilder/Bots/4449e5bcbfaa89a18949b4b093185630/DerivedData/Build/Intermediates.noindex/my-ios-project.build/Release-iphonesimulator/my-scheme.build/Script-21A92E061D93E0B700C4948E.sh\"
/Users/xcodeserver/Library/Caches/XCSBuilder/Bots/4449e5bcbfaa89a18949b4b093185630/Source/my-ios-project/scripts/my-script.sh: fork: Resource temporarily unavailable
/Users/xcodeserver/Library/Caches/XCSBuilder/Bots/4449e5bcbfaa89a18949b4b093185630/Source/my-ios-project/scripts/my-script.sh: fork: Resource temporarily unavailable
Anyone experience with this?
Most probably there would be a recursive call involved. Check that you are not naming your bash functions and external functions the same.
I see below error while packaging appium project for AWS.
Unknown lifecycle phase --DskipTests=true. You must specify a valid lifecycle phase or a goal in the format
Note:
Executing packaging command on mac terminal
Tried both --DskipTests=true & -DskipTests=true (see same error for both)
Looking forward for some help. Thanks!
I work for the AWS Device Farm team.
I have seen this error when users copy-paste the command from the documentation.
We are working on updating this as there seems to be some unknown characters that get introduced.
Users have got this to work by deleting -DskipTests=true and typing it instead of copy pasting it.
Since you are on a Mac terminal you will need to use a single dash '-' for the parameter.
Apologies for the inconvenience.
Hope this helps.
I'm trying to setup Firebase Crash Reporting on a Swift project. I'm using Xcode 7.3. Firebase Crash Reporting version is 1.0.7.
After following all steps properly, this is the error I'm getting on Xcode, which isn't allowing my project to run:
http://imgur.com/a/DtHTH
I've also tried to manually upload it using batch-upload, but it gives me an error:
./batch-upload: line 121: FIREBASE_API_KEY: environment variable empty or unset
Explicitly add to environment or set GoogleService-Info.plist (-p)
and Info.plist (-i) flags to extract values from the files.
Try "./batch-upload -h" for details.
Am I missing anything?
To get the Xcode script to work, the invocation in your run script phase needs to look something like
# Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist file
GOOGLE_APP_ID=1:1234567890123:ios:1234abc567de89
# Replace the /Path/To/ServiceAccount.json with the path to the key you just downloaded
"${PODS_ROOT}"/FirebaseCrash/upload-sym "/Users/yourname/yourproject/Your Project Name-5632e387efda6.json"
The JSON file is a file you've downloaded after creating a service account in the Firebase Console. Here's instructions on how to do that.
To get batch-upload to work, the invocation of that script is more complicated and might look something like
batch-upload -p path/to/your/project/GoogleService-Info.plist -i path/to/your/project/Info.plist path/to/your/service/account/file/Your\ Project\ Name-abc123def456.json path/to/something.dSYM/DWARF/SomeBinaryName
I'm apologize for this process being a bit arduous and arcane--it's definitely something we're aware of and working on fixing!
Answer from: firebase-support#google.com
Can you go over the following items and see it will work:
reset your OAuth credentials, run below command:
rm $HOME/Library/Preferences/com.google.SymbolUpload*
create new service account and make sure it has editor permission
Revise your script into below format:
# Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist file
GOOGLE_APP_ID=1:my:app:id
# Replace the /Path/To/ServiceAccount.json with the path to the key you just downloaded
"${PODS_ROOT}"/FirebaseCrash/upload-sym "/Path/To/ServiceAccount.json"
Remember to follow the instructions on this link
Please make sure your app id and json file path are correct.
I hope this helps.
I'm using a bot to archive an iOS app, and I need to get the .ipa product path in order to publish it into our distribution system.
Bot settings:
And using a script to print all env variables, non of them contains a path to the ipa file. In addition, some of the variables are pointed to directory that does not exist, i.e: XCS_OUTPUT_DIR
Here the env variable output:
XCS=1
XCS_ANALYZER_WARNING_CHANGE=-31
XCS_ANALYZER_WARNING_COUNT=0
XCS_ARCHIVE=/Library/Developer/XcodeServer/Integrations/Integration-771867708dfac45bba10a1998c118912/MyApp.xcarchive
XCS_BOT_ID=771867708dfac45bba10a1998c007d43
XCS_BOT_NAME='MyApp Distribution'
XCS_BOT_TINY_ID=DBB85BD
XCS_DERIVED_DATA_DIR=/Library/Developer/XcodeServer/Integrations/Caches/771867708dfac45bba10a1998c007d43/DerivedData
XCS_ERROR_CHANGE=-1
XCS_ERROR_COUNT=0
XCS_INTEGRATION_ID=771867708dfac45bba10a1998c118912
XCS_INTEGRATION_NUMBER=19
XCS_INTEGRATION_RESULT=warnings
XCS_INTEGRATION_TINY_ID=F7D4469
XCS_OUTPUT_DIR=/Library/Developer/XcodeServer/Integrations/Integration-771867708dfac45bba10a1998c118912
XCS_SOURCE_DIR=/Library/Developer/XcodeServer/Integrations/Caches/771867708dfac45bba10a1998c007d43/Source
XCS_TESTS_CHANGE=0
XCS_TESTS_COUNT=0
XCS_TEST_FAILURE_CHANGE=0
XCS_TEST_FAILURE_COUNT=0
XCS_WARNING_CHANGE=0
XCS_WARNING_COUNT=26
XCS_XCODEBUILD_LOG=/Library/Developer/XcodeServer/Integrations/Integration-771867708dfac45bba10a1998c118912/xcodebuild.log
XPC_FLAGS=0x0
XPC_SERVICE_NAME=com.apple.xcsbuildd
In addition to that, I was able to confirm that .ipa files are being created in another folder (<path to server>/IntegrationAssets/<integration id>/<integration number>/), but that path is not accessible from an env variable.
Any ideas?
Well, after a lot of research and testing and all, apparently there is something wrong with bots in the latest Xcode (7.2) + Server version (5.0.15) not loading the correct environment variables.
My current solution was to create the path manually based on existing env variables:
ARCHIVE_PATH="${XCS_ARCHIVE}"
ARCHIVE_NAME="${ARCHIVE_PATH##*/}"
IPA_NAME="${ARCHIVE_NAME%.*}.ipa"
IPA_PATH="${XCS_OUTPUT_DIR}/ExportedProduct/Apps/${IPA_NAME}"
Which I did based on:
Continuous integration Xcode Server after trigger $XCS_PRODUCT not set
Just a small update--In Xcode 9.4.1 at least $XCS_PRODUCT is set correctly, so you can just use that, e. g. for HockeyApp:
curl -F "status=2" -F "notify=1" -F "ipa=#${XCS_PRODUCT}" -H "X-HockeyAppToken: <token>" https://rink.hockeyapp.net/api/2/apps/upload