Exiting because upload-symbols was run in validation mode - ios

Im trying to add Fabric to my xcode project. I've done so succesfully in the past but now facing issues with a react-native project. Having looked around, i've tried pretty much all combinations suggested out there. My setup looks like so:
I've also tried the Pods version using "${PODS_ROOT}/Fabric/run" however no matter what i do im unable to proceed from the Add Run Script step.
In attempt to try and debug i've directed the output of what the Fabric command produces to a file. It yields the following:
Running upload-symbols in Build Phase mode Validating build
environment for Crashlytics... Validation succeeded. Exiting because
upload-symbols was run in validation mode
Any help much appreciated. Im very unsure as to how to take it from here
ADDITIONAL_INFO:
I've reinstalled the Fabric Mac app from scratch, restarted both xcode,fabric app and the whole system in general. Tried building in release mode and have pretty much tried everything here:
Crashlytics in iOS won't proceed past "Build Your Project" in Fabric app

The "Exiting because upload-symbols was run in validation mode" message is a bit misleading because it also appears when everything works... I'm using the latest Firebase Crashlytics 4.0.0, but it produces exactly the same output as the older Fabric scripts.
The comments in
${PODS_ROOT}/FirebaseCrashlytics/run
explain it well:
# run
#
# This script is meant to be run as a Run Script in the "Build Phases" section
# of your Xcode project. It sends debug symbols to symbolicate stacktraces,
# sends build events to track versions, and onboards apps for Crashlytics.
#
# This script calls upload-symbols twice:
#
# 1) First it calls upload-symbols synchronously in "validation" mode. If the
# script finds issues with the build environment, it will report errors to Xcode.
# In validation mode it exits before doing any time consuming work.
#
# 2) Then it calls upload-symbols in the background to actually send the build
# event and upload symbols. It does this in the background so that it doesn't
# slow down your builds. If an error happens here, you won't see it in Xcode.
#
# You can find the output for the background execution in Console.app, by
# searching for "upload-symbols".
#
# If you want verbose output, you can pass the --debug flag to this script
Just a reminder: if you want to see the messages in Console.app, start the app first...

I had this problem and I solved it by checking the "Run script only when installing" located near the Build Ph

Chintan from Fabric/Firebase support. Can you check if in the build settings,
DWARF with dSYM
files has been selected as your
Debug Information Format
Also, delete the app from the device / simulator, clean the project, rebuild, run and install the app again. Contact support(at)fabric(dot)io if this doesn't work, your app might need manual activation.

As #llude mention, in order to send the DYSM to FirebaseCrashlytics you only need to add one line in the Code build phases script: ${PODS_ROOT}/FirebaseCrashlytics/run
As mentioned in the setup guide:
https://firebase.google.com/docs/crashlytics/get-started?platform=ios#initialize-crashlytics
note that you will need to add 2 fields as input files (in the build phase script) in order for the update-symbols to send the DYSM file:
plist file path
dysm file path

Related

Xcode build never finishes when upload-symbols in Build Phase Run Script for FirebaseCrashlytics

I have apply Firebase Crashlytics in my app. I have implemented the following in my Run Script, under Build Phases in Xcode:
I also config into Build Settings:
and the message I receive when Xcode building :
Running upload-symbols in Build Phase mode
Validating build environment for Crashlytics...
Validation succeeded. Exiting because upload-symbols was run in validation mode Fetching upload-symbols settings...
Command PhaseScriptExecution failed with a nonzero exit code
Has anyone had success in implementing the upload-symbols script in their Run Script? Any ideas why my Build stalls and never finishes
you do not need to "call upload-symbols" (second line in your script)
You should only call "run".
For run also add 2 input files for the script:
./GoogleService-Info.plist //path to your plist
"${DWARF_DSYM_FOLDERPATH}/${DWARF_DSYM_FILE_NAME}"
You can also add --debug argument to run to verify if it's find correct dsym file location "${PODS_ROOT}/FirebaseCrashlytics/run --debug"
if you look into Firebase\FirebaseCrashlytics\run you will see the following:
# This script calls upload-symbols twice:
#
# 1) First it calls upload-symbols synchronously in "validation" mode. If the
# script finds issues with the build environment, it will report errors to Xcode.
# In validation mode it exits before doing any time consuming work.
#
# 2) Then it calls upload-symbols in the background to actually send the build
# event and upload symbols. It does this in the background so that it doesn't
# slow down your builds. If an error happens here, you won't see it in Xcode.
I had the same issue a few days ago, upgrading Firebase to latest version fixed it.

Xcode 11 unable to CopyPlistFile plist file that was just copied using build phase

I'm trying to follow the instructions here (for iOS) for setting up multiple environments for my React Native project. The idea is that I can make use of Build Phases to copy any plist into GoogleService-Info.plist to enable the use of different Firebase environments for different Xcode schemes.
I've made a user-defined build setting for each of my 4 Xcode configurations called GOOGLE_SERVICE_PLIST_SUFFIX, and I have a build phase (it's the first one that's run before React native Copies and Bundles its required assets) with the following code:
cp -r "GoogleService-Info"$GOOGLE_SERVICE_PLIST_SUFFIX".plist" "GoogleService-Info.plist" &
wait $!
echo "${GOOGLE_SERVICE_PLIST_SUFFIX} Firebase plist copied"
I can tell that the copying is indeed successful, but for some reason the build fails with this error:
The following build commands failed:
CopyPlistFile /Users/andersonaddo/myappname/ios/build/biteup/Build/Products/Prod.Debug-iphonesimulator/Myappname.app/GoogleService-Info.plist /Users/andersonaddo/myappname/ios/GoogleService-Info.plist
(1 failure)
Looking at the error trace, this error is explained a bit further:
CopyPlistFile /Users/andersonaddo/myappname/ios/build/myappname/Build/Products/Prod.Debug-iphonesimulator/Myappname.app/GoogleService-Info.plist /Users/andersonaddo/myappname/ios/GoogleService-Info.plist (in target 'myappname' from project 'myappname')
cd /Users/andersonaddo/myappname/ios
builtin-copyPlist --convert binary1 --outdir /Users/andersonaddo/myappname/ios/build/myappname/Build/Products/Prod.Debug-iphonesimulator/Biteup.app -- /Users/andersonaddo/myappname/ios/GoogleService-Info.plist
error: Build input file cannot be found: '/Users/andersonaddo/lunchme/ios/GoogleService-Info.plist' (in target 'biteup' from project 'biteup')
Does anyone have any idea why this behaviour may be happening? If i try and build again after the first failure, I don't run into this issue because the copied file remains in the ios directory from the first attempt.
I've achieved a similar outcome to what you are after by using schemes and a build script against each scheme.
I used an approach similar to what's details here to set up alpha (dev), beta (stage) and prod builds:
https://blog.echobind.com/a-12-factor-approach-to-environment-specific-builds-in-react-native-ae1fb77ed799
Then I set up the 3 apps in Firebase and saved the plist files in my app with relevant names (eg GoogleService-Info-beta.plist).
Lastly, I added to the run script for each scheme (as below) and it works great.
RN # 0.62.2, RNFB # v7.1.0
I've added the file that gets copied to (GoogleService-Info.plist) to my gitignore as it obv changes when I run diff schemes on my machine

FirebaseCrashlytics auto upload-symbols problem

I'm trying to implement new FirebaseCrashlytics in my iOS app and having some issues and some things are not clear at all.
As per Upgrade doc in step 3, I have to add following run script:
${PODS_ROOT}/FirebaseCrashlytics/run
/path/to/pods/directory/FirebaseCrashlytics/upload-symbols
so, in my case it is:
"${PODS_ROOT}/FirebaseCrashlytics/run"
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols"
But compile was failing because:
Running upload-symbols in Build Phase mode
Validating build environment for Crashlytics...
Validation succeeded. Exiting because upload-symbols was run in validation mode
[31merror: No Google App ID or Google Services file provided[0m
Command PhaseScriptExecution failed with a nonzero exit code
If I delete upload-symbols line it is working fine, I'm getting crashes in Dashboard, but as far as I understand this upload-symbols has to upload dSYM files of app users, so I have no worry about this. Means I still need it...
So I tried to replace them:
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols"
"${PODS_ROOT}/FirebaseCrashlytics/run"
And it started to compile.
I did a force crash and got it in Dashboard, but also I got:
Does it mean that it is not working and it is must be after run, so I continued and finished with:
"${PODS_ROOT}/FirebaseCrashlytics/run"
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}"
Now I was able to compile, but still getting optional dSYM in Dashboard.
Now I'm completely lost, if anyone can clarify it would be great.
PS: I'm able to use upload-symbols from terminal, but it is kind of manual job.
Few more questions as a discussion:
Why in Upgrade docs it is run and upload script, but in Get started only run?
In Upgrade docs it is exact path for ${PODS_ROOT}/FirebaseCrashlytics/run but not exact for /path/to/pods/directory/FirebaseCrashlytics/upload-symbols they are same folder, why not use same?
in Get started docs there are input files and one of them is $(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) why they are using (, not {?
This path $(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH) is path to Info.plist file, not to GoogleService-Info.plist why they gave it then?)

“Unable to auto detect APP_BUNDLE_PATH” error while running the Calabash test on iOS

I’m new to the Calabash iOS automated testing. I have installed “Xcode 4.2”, “Ruby version 2.0.0p643” and “calabash-cucumber gem” on Snow Leopard (version 10.6.8)
I ran the command “calabash-ios setup” and created a target (test-cal target) for my test iOS project. With this command, CFNetwork.framework and calabash.framework are added to the test-cal target.
After that, I ran “calabash-ios gen” in terminal and created a subdirectory called features and manually added features subdirectory to test-cal target.
I wrote a test script in “sample.feature” file under the features folder and then executed the cucumber command in terminal to test the script.
After running the command it is giving me following error:
Scenario: Sample test # features/sample.feature:3
Unable to auto detect APP_BUNDLE_PATH.
Have you built your app for simulator?
Searched dir: /Users/octaneconference/Library/Developer/Xcode/DerivedData/Test-frkimcejhwemmaaapwknwfwvhnmb
Please build your app from Xcode
You should build the -cal target.
Alternatively, specify APP_BUNDLE_PATH in features/support/01_launch.rb
This should point to the location of your built app linked with calabash.
(RuntimeError)
./features/support/01_launch.rb:29:in `Before'
Given the app has launched # features/steps/sample_steps.rb:1
And then the Sound Enable screen will appear # features/sample.feature:5
When click on "NO" button # features/sample.feature:6
Then Menu screen will appear in the screen # features/sample.feature:7
Then take a picture # features/sample.feature:8
Failing Scenarios:
cucumber features/sample.feature:3 # Scenario: Sample test
1 scenario (1 failed)
5 steps (1 skipped, 4 undefined)
0m0.965s
You can implement step definitions for undefined steps with these snippets:
Given(/^then the Sound Enable screen will appear$/)
do
pending # Write code here that turns the phrase above into concrete actions
end
When(/^click on "([^"]*)" button$/) do |arg1|
pending # Write code here that turns the phrase above into concrete actions
end
Then(/^Menu screen will appear in the screen$/)
do
pending # Write code here that turns the phrase above into concrete actions
end
Then(/^take a picture$/) do
pending # Write code here that turns the phrase above into concrete actions
end
I’d appreciate any suggestions/thoughts regarding fixing this issue.
For starters, please ensure that you are using at least OSX Yosemite or later, Xcode 6 or later (preferably >= 7), and please ensure you have the latest calabash-cucumber gem (at the time of writing, 0.17.0). You can verify this by running
calabash-ios version
Secondly, from where are you running the cucumber command? If you are trying to get a test to run on a simulator from an xcode project, you'll need to be in the same directory as <app_name>.xcodeproj . As the error message suggests, you'll also need to make sure you've actually built the project for the simulator prior to running.
If you are trying to run the test on a simulator app bundle (a folder with a .app extension), then you can instead run:
APP_BUNDLE_PATH=/path/to/appname.app DEVICE_TARGET="<UUID>" cucumber
(you can find the uuids of your simulators by running instruments -w devices )
For what it's worth, I'd also recommend checking out the calabash-sandbox for a simplified ruby setup.

Crashlytics in iOS won't proceed past "Build Your Project" in Fabric app

I'm installing Crashlytics for my iOS app. I downloaded it via their site link, and went through all the steps for integrating the frameworks, adding the run script, etc.
I was experiencing an issue, so I removed the frameworks and decided to start over and try a fresh install. But the Fabric app updated to a newer version, and now when I try to reinstall Crashlytics into my app, it doesn't give me the option to reinstall the frameworks. It goes straight from clicking "install" to the "Build your project" screen, which I cannot pass.
To help configure your project, please build it now by pressing ⌘B
I press ⌘B, it builds and nothing happens. I think the issue is because I removed the Crashlytics and Fabric frameworks from my project, but I can't see a way to add them back again. The Fabric app doesn't give me that option.
Go into Build settings of the your target.
Find "Debug Information Format".
Set this from "DWARF" in both debug and release to "DWARF with dSYM File"
Moving from Comment to Answer.
Mike from Fabric here. If you back up through the Mac app, then click on the arrow in the top-left, click on "+ New App", that will walk you through re-adding everything.
If you check the resource navigator you may see the following message:
"DEBUG_INFORMATION_FORMAT should be set to dwarf-with-dsym for all configurations. This could also be a timing issue, make sure the Fabric run script build phase is the last build phase and no other scripts have moved the dSYM from the location Xcode generated it. Unable to process eCreditWebWrapper.app.dSYM at path"
Go to Build Settings and search for "Debug Information Format". Ensure "Debug" is set to "DWARF with dSYM File".
Without the dSYM file Fabric won't work.
As for Xcode 10.2.1, the automated installation via Fabric Mac app won't work anymore. New apps cannot be added via the New App Step-by-step guide.
You have to follow the manual installation instructions. Download and add the 2 frameworks into your Xcode workspace, then add the Run Build Script phase (and related Fabric codes), then build the App. Last (very important), run the app in an actual device.
Once the App is successfully launched, the new App information will be available in the Fabric dashboard as well as the Fabric Mac App (needs to relaunch the App to see the new app).
Here are the steps:
Download the 2 frameworks
Drag to your project where your App Delegate is (make sure ticked "Copy items if needed")
Compile the project / workspace in Xcode
Add the "Run Script Phase" as instructed here; note that Xcode 10+ requires an extra configuration at Input Files
Add the required import and initialization codes in App Delegate
Add the Fabric API keys in Info.plist
Compile again
Run the App in a real device. You will see the line Crashlytics in the Xcode log. If no log appears, checks if your active scheme contains OS_ACTIVITY_MODE settings. Set it to default if the current setting is disabled.
If the Crashlytics line appears, that means the manual installation is working; you will see your App appearing at Fabric online dashboard.
I have solved this issue by the following way. Following the advise from above, I began adding a new app to crashlytics. When I reached to adding new "Run script" build phase, I just copied that text and pasted it over the previous one(created with Crashlytics).
I have also unchecked "Run script only when installing".
After this, I canceleed adding a new app and procedeed back to the UPGRADE. At this moment, building the app, can pass you to the next step and you don't get stuck on that screen anymore.
I was stucked on Build phases too.
I have also unchecked "Run script only when installing" and press again command+B and then I passed to the next step.
If the script is not running, you may have checked the "run script only when installing" in the run script section.
I hope it helps
TL;DR
Tap your scheme -> edit scheme -> set build configuration to "Release"
Explanation:
The most voted answer sounds about right, but there are situations where you just don't need crashlytics in debug builds (who wants crashes sent when you just develop and experiment with your code?). In this case you should disable crashlytics by checking debug compilation flags (out of scope of this answer) and for the first time during installation build app for release to let crashlytics know that you built app.
I had the same issue today. The problem was that i didn't have the run-script :
./Fabric.framework/run <api key>
in my project. Once i put this back in then it all worked perfectly. I also cleaned my project and deleted derived data just to be sure.
you must check that your deployment target version because of "Fabric's minimum iOS version is 6.0"
I was only able to get the Fabric app to continue the installation process after setting my build target to 'Generic iOS Device' and creating an archive from the Product > Archive menu.
Simply building the app or running it on an emulator doesn't seem to trigger the Fabric App to proceed.
If you use Xcode 10.
Project Navigator -> your project -> Targets -> Build Phases -> your Run Script for Fabric -> Input Files -> "+" (add input file) -> clear field and past this line:
$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
Be sure to remove this: $(SRCROOT)/
In the Run Script build phase there is a call:
./Crashlytics.framework/run <your_api_key_here>
Maybe you added some conditions to trigger it only on certain builds like:
releaseConfig="Release"
if [ "$releaseConfig" = "${CONFIGURATION}" ]; then
echo "Running Crashlytics"
./Crashlytics.framework/run <your_api_key_here>
fi
so that it will not just trigger on ⌘B
See https://dev.twitter.com/crashlytics/ios/advanced-setup
In my situation I was following all the steps correctly but got stuck on 'add build phase' step.
Then I just restarted fabric and all works just fine
Also there are some other possible actions:
1) Just restart Fabric, Xcode and your Mac.
2) Also if you use Cocoapods change build phase line from
./Crashlytics.framework/run [yourAPIKey]
to
"${PODS_ROOT}/Fabric/run" [yourAPIKey]
3) After building project if Fabric will stop responding just wait a while. It took about minute on my Mac.
Thanks, I solved the problem by removing folders:
~ / Library / Caches / com.crashlytics.data
~ / Library / Caches / com.crashlytics.mac
Kindly cross verify that run script you adding is to your actual target if u will add to tests target it will not proceed until you add it to actual target
None of the solutions here worked for me. The scenario for me was someone else added the Fabric framework to our project and committed it to the repo. The run script on their computer launched/triggered the Fabric Plugin, but would not launch/trigger on mine, although it did not report errors.
The solution was to create a separate project, using Cocoapods download the same version of Fabric, replace the run script in our project/repo (and the one referenced in the target's run script) with the downloaded version from Cocoapods. Rebuild and then the plugin would respond.
Comparing the two run script files, they are drastically different, but the run script from Cocoapods was not a flat text file and it was unreadable. So I'm not sure what was different between the scripts, but we somehow got different versions of the script while using the same version of Fabric.
What I did wrong was adding the script to the pods project build phase instead of the main project build phase, adding it to the main projects build phase solved the problem.
If you are duplicating the target, remove the run script from build phase and add it again to solve the issue.
If you have multiple TARGETS,
check your Schema selection is correct before you build project.
For Xcode 10. Add your app's built Info.plist location to the Build Phase's Input Files field:
$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
This solved my issue i hope this can solve others issue.
It turned out I had not enough permissions to create new project in Fabric.
Upgrading from Member to Admin resolved the issue.
In my case, removing an app from helped.
1) Remove the app from Fabric.
2) Follow all the steps again to add the app and install Crashlytics.
Nothing helped me. Now Fabric catches my archive creation. But I create the archives via fastlane's build_app.
Open Project in higher version of Xcode. This resolved my issue after waste many hours.
My Project build on Xcode 10.2 and I was running on Xcode 10.1 but when I run the same project on Xocode 11. The build was succeeded.
Try to wrap your run script variable with double quotes ""
"${PODS_ROOT}/Fabric/run"
Go to folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/<CURRENT_IOS_SDK>/usr/lib/ and delete all .dylib files.
It worked for me.

Resources