Firebase crashlytics script in iOS(2021) not working via Testflight - ios

I am trying to integrate firebase crashlytics into iOS app.
During integration I added run script to upload crashes automatically.
I connected my iPhone_XR to Xcode and ran in release mode. Then I force crashed.I repeated it several times. After few hours of waiting I was able to see the crashes. Confirming that this is working as expected I archived and released this build(DEV) to testflight via xcode.
I did the same force crashed after installing via testflight but this time its not working... Most of the people suggested to upload manually but I am afraid I can't do that as I don't have access to client application(PROD) and also maintaining the crashes report manually is a tidious process to me
Please help me what exactly is happening with Firebase crashlytics. I checked many blogs and github issues for understanding. Most of them are saying to upload manually dSYM files.
Note: GoogleServices file is inside some folder so I gave the path of that in script. I tried to add directly without any sub-folders also but issue still persists.
4-MAR crashes are from my phone which are crashed during testing.
I am supposed to receive some crashes on 5-MAR which are crashed via Testflight but it's saying missing dSYM files
Please help with this issue. I am not unable to find proper solution from past 2 months

Try this script:
${PODS_ROOT}/FirebaseCrashlytics/run
${PODS_ROOT}/FirebaseCrashlytics/upload-symbols -gsp $PROJECT/GoogleService-Info.plist -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
Also, Firebase recently updated their SDK.

Related

Crashlytics report can be generated only after re run the app

I just implemented Fabric Crashlytics tool to my Xcode project via Swift Package Dependencies.
All works good if I enable Google Analytic on a step when I create an app, without this step I did not received crash reports, so I switched to the app with Google Analytic enabled.
I've tested crash button from the link:
One comment that I don't like from there
"After your app crashes, run it again from Xcode so that your app can
send the crash report to Firebase."
Does it mean that user has to reopen app to send crash report? For example if a user download an app from the App Store and then somehow the app is crashed. Does mean that reopening app required for sending that crash? And if the user will not open the app it means I lost this crash report? I understand that on live store there is no option to re run it form Xcode, but reopening seems a require step.
I suppose the crash report should work different a bit by sending issue details right after a crash, I may be wrong here.
Also when I set everything via Swift Package Dependencies looks like I don't have an option to upload dSYM via this option
/path/to/pods/directory/FirebaseCrashlytics/upload-symbols -gsp /path/to/GoogleService-Info.plist -p ios /path/to/dSYMs
Does this mean I need to pull Fabric and Crashlytics from CocoaPods?
I've switched off bitcode at the moment and looks like all is works automatically but not sure it is good idea for long perspective.
Yes, crashes will be uploaded when restarting the app after it crashes. As far as I know, this is because the SDK may not have enough time to actually send the report when the crash happens.
If you are using Swift Package Manager, you still have that option.
This is the command:
"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"
If the app has bitcode enabled, then you'll need to download the dSYMs from the App Store and upload them manually.
Lastly, Fabric is now deprecated so don't download it. You don't need to use Cocoapods if you are already integrated Crashlytics with SPM.

Crashlytics asks for dsym files that don’t exist

Crashlytics asks for dsym files that don’t exist.
I’m using Firebase/Crashlytics iOS SDK.
I notice this happens after I update to Firebase 6.34.0. (Previously 6.28.1)
I see some crashes get symbolicated correctly for the same version that
crashlytics asks for missing dsyms. Not sure how this can happen…
I normally use fastlane download_dsyms and faslane upload_symbols_to_crashlytics to take care of dsym uploading. Which had worked fine.
I already tried manually uploading using script Pods/Firebase Crashlytics/upload-symbols -gsp Config/GoogleService-Info.plist -p ios <downloaded_dsyms_dir> to upload the symbols I downloaded from appstoreconnect.apple.com, waited 24 hours, still doesn’t work.

No new App created in Fabric though fastlane beta says build uploaded to Crashlytics

I've been able to create and upload one new iOS app and two new Android apps in Fabric however, this particular iOS build will not upload to Fabric. I have gone through all the motions outlined in their tutorials and can run fastlane beta which runs successfully and says
[15:14:12]: Uploading the build to Crashlytics Beta. Time for some ☕️.
[15:14:20]: Build successfully uploaded to Crashlytics Beta 🌷
[15:14:20]: Visit https://fabric.io/_/beta to add release notes and notify testers.
However, this doesn't produce an app in Fabric. When I run through the steps for a Crashlytics upload either using the manual option or using the Mac App, I am unsuccessful. The Fabric app just leaves me with "to continue, build your Xcode project by pressing command-B," which does not do anything, I'm just stuck at that screen. I have tried every answer outlined in the Stack Overflow post here which should have addressed this problem but does not for me.
In short, I have successfully uploaded two Android apps and an iOS app to Fabric using this workflow but cannot get this iOS app to upload regardless of what's indicated by the command line.
If it matters, this is Cordova app.
The answer was tricky and bizarre so I'll post it for future reference. The trick was two steps (as far as I can tell, this is what made it work). First, run:
./Crashlytics.framework/submit *api_key* *build_secret* -ipaPath ./buildname.ipa -emails ***#*** -notifications YES
in the directory which contains your Crashlytics.framework file. This is probably the same folder as your xcodeproj file for your app. You should have this file in that directory after following the steps outlined in my post above.
Then open the xcodeproj and build and run the file (for me I had to run it on an emulator not just the physical iPhone I had connected to my Mac).
This created a new Fabric app. I have not seen any answers like this on Stack Overflow so hopefully this is helps anyone like me. I still have no idea what the root issue really was here.

Unable to upload missing DSYM files In Fabric Crashlytics with Bitcode enabled to NO

I have Implemented Fabric Crashlytics in my project manually. And in my application I'm using an external device connection for that I'm using an SDK, so for that SDK I have set bitcode to NO in my project. Before It used to work fine and I used to find my crash reports in crashlytics. But all of a sudden since from a week It is asking for missing DSYM files, and I'm not able to find any crash reports in crashlytics Dashboard. I have followed Fabric Doc and tried to upload DSYM zip files manually. But no luck as I got stuck in the same page with processing message as shown in below link.
enter image description here
https://docs.fabric.io/apple/crashlytics/missing-dsyms.html
Can any one walk me out from this? Thanks In Advance.

Crashlytics is not sending Crash report from iPhone

I've setup the Crashlytics in my one iOS application and installed the application on a real device. My Crashlytics Dashboard is displaying that, I've successfully added the app. However, it's not sending crash report. My internet speed is not so good. But I can check my emails from this device. Can anybody guess, where is the problem?
Xcode debugger does NOT allow Crashlytics to process crash reports. Yeah, that seem weird even to me when I read that first time but it is a fact (Source). That's is the reason we never see crash report When:
- running app in Simulator
- running app on iDevice by directly build and run from Xcode with debugger on.
To make sure a crash is reported during your testing (copied from Crashlytics support site):
1. Launch simulator
2. Press stop
3. Launch your app and force a crash
4. Relaunch the app from simulator
5. See the crash report in the web dashboard.
EDIT:
Added a reference; Crashlytics also provides a short article on a quick way to force a crash.
My be it's late but work 100%
Make some changes in project build settings like in below image
and follow these instructions.
The primary reason any crash reporter won't work on iOS is due to interference from different crash reporters. However, with Crashlytics specifically there could be something specific to them causing the crash report not getting reported.
Xcode debugger does NOT allow Any Crash Reporter to process crash reports. This is because XCode overrides any hooks into the crash handling call backs. This only happens when:
running app in Simulator (with debugger on)
running app on iDevice by directly build and run from Xcode with debugger on.
To make sure a crash is reported during your testing (http://support.crashlytics.com/knowledgebase/articles/92523-why-can-t-i-have-xcode-connected-):
Launch simulator
Press stop
Launch your app and force a crash
Relaunch the app from simulator
See the crash report in the web dashboard.
While a super old video it's still relevant, here's a video of the steps above (example from Crittercism): https://www.youtube.com/watch?v=sU6Su3PBFH4
For me, the problem was that the device was connected to my Mac :)
From this source:
Also, if you have your device connected to your Mac, XCode's debugger
will step in as well. So just disconnect the device before testing :)
I found solution using following steps
1. Go to Edit Scheme
2. Run -> Info
3. Change Build Configuration to release.
Now run the app crash it. You will receive mail.
We recently ran into this issue and I found that somewhere along the way the build script was removed. Adding it back in with the following fixed the issue for us:
./Crashlytics.framework/run <your_api_key> <build_secret>
Note : When using Cocoapods you will want to us the following instead of the above (source):
./Pods/CrashlyticsFramework/Crashlytics.framework/run
Adding a build script:
To add a Run Script Build Phase in Xcode 6, select your application target in your project, then select "Build Phases".
Click the small "plus" icon and select "New Run Script Build Phase".
You should now see a Run Script section in the middle of your Build Phase options, as shown above.
Inside the body of the Run Script Build Phase, paste in the script.`
The above quote comes from Crashlytics's visual tutorial, referenced in this post.
Note: I originally posted this answer verbatim for Crashlytics error code: 202 when Submitting files.
From the RayWenderlich site:
You won’t get any crash reports if Xcode intercepts the crash event!
To make all the examples below work, you have to build and run the
application, then click the stop button on Xcode. This way you will
have the latest version installed on the the device. Once that is
done, you can launch the app on the device itself, and then crash it
all you want! All the crashes on your iOS device will be caught and
sent to the server component of the service that you have integrated
into the app. Crash reports are usually sent to the server the next
time you start the app, so the steps to follow to generate a crash
report on the server are as follows: Build and run on Xcode. Press the
stop button. Run the app on your iOS device. Make the app crash. Run
the app again.
Crashlytics works for me until now.
I don't know why but now it doesn't work.
You should turn debug-mode on by
[Crashlytics sharedInstance].debugMode = YES;
My problem is here Crashlytics error code: 202 when Submitting files :(
Make sure you are not forcing the crash too early.
Set [Crashlytics sharedInstance].debugMode to YES;
Watch for
Crashlytics] Settings loaded
on the Xcode console logs.
Then force the crash and restart the app, and the crash will be reported now.
I ran into a similar problem when trying the test crash code.
Crashlytics.sharedInstance().crash()
I was running my app from a device, without Xcode, and the crash wouldn't show up on Crashlytics Dashboard. What worked for me was the following tip from Crashlytics website:
Make sure to launch the app after crashing it, so that the crash can
be uploaded
I commented out the above crash() call, and re-ran the app. Then the crash showed up in the Dashboard.
This is for xcode 9, from crashlytics 3.4.0
After doing this, be patient and wait for a few minutes.
Have you tried running [[Crashlytics sharedInstance] crash] on a device and seeing if that gets reported? There are a few reasons why Crashlytics might not work including other crash reporters etc.
If you don't upload the dSYM file, Crashlytics will not show your crash even though the report successfully uploaded.
You could run into this problem, if you have set up your build-script to only run on your CI server. Then if you have copied your app to your phone via xcode and you run it without being attached to the debugger, the report will be uploaded but ignored, because of the missing dSYM file.
Sometimes, it takes some time for the logs to show up. I am able to find them after 15-20 mins
One of the issue I feel that in the Run Script Phase, it should be a separate Run Script Phase for CrashLytics. When had the run script
./Fabric.framework/run
With some of my other script, everything was ok, CrashLytics log show report submitted, but nothing was in the web interface.
When I add another Run script phase only with Fabric run, it appears like a magic :)
My first try was with cocoapods, but that did not work.
When I manually add all the framework and a separate run script phase that worked.
This worked for me,
If you're testing on iDevice, just unplug iDevice with your Xcode and run your app.
Now, If crashed it will be updated on dashboard.
I solved by deselecting "Run Script only when installing" option in Run script (one for Fabric(crashlytics))

Resources