Crashlytics not sending events on iOS - ios

I've migrated our app from react-native-firebase to #react-native-firebase/crashlytics and managed to get crash reports from Android, but no luck with iOS.
I've done all the following:
removed react-native-fabric and all of it's references
installed #react-native-firebase/app
installed #react-native-firebase/crashlytics
added GoogleServices-info.plist in xCode as described in the manual
added firebase.json in the root of the app with crashlytics_debug_enabled: true (this solved Android)
But still no success, not from the simulator nor from appCenter deployed app.
I think it's good to mention that we have 3 schemes (dev, staging, production).
Any idea how to make this work?

Chintan from Firebase. Can you reach out to Firebase Support with the bundle ids of all 3 variant? You can also reference this SO post in there. It might just need manual activation.

Related

Can't get debug token for Firebase App Check for my Flutter iOS App

So I recently started setting up app check for my existing Flutter project (for both android and iOS platforms). I've had no problem with android's "Play Integrity", got the necessary debug token, and can successfully send and retrieve data to/from firestore (app check for firestore is currently enforced for my project).
The problem is, I can not get such a debug key for my iOS app. I will list the sources I've used and what I've tried so far.
I have firebase_app_check: ^0.1.1+8 installed via pubspec.yaml
I also added pod 'FirebaseAppCheck' to my Podfile
I have the necessary initialization code in my main.dart: await FirebaseAppCheck.instance.activate(...);
For "DeviceCheck", I am using THE SAME private key that I am using
for "Sign in With Apple" (which I have implemented successfully). I
have also enabled the checkbox for DeviceCheck in the settings of
that private key (in Apple Developer).
For my App ID (Apple Developer > Identifiers > App IDs), I have also
enabled the checkbox for "App Attest".
I have put "-FIRDebugEnabled" as an argument passed on launch in
XCode > Product > Scheme > Edit Scheme.
I always uninstall my app from my iOS simulator (iOS 16.2) or real device (iOS 16.1.2),
before trying again, because I have read across multiple forums that
the debug token only gets printed to the output the first time you
run your app.
I have also added these 4 lines of code in my AppDelegate.swift from here:
#if DEBUG
let providerFactory = AppCheckDebugProviderFactory()
AppCheck.setAppCheckProviderFactory(providerFactory)
#endif
Official firebase docs "iOS+ (App Attest)":
I have NOT copied ANY code from this page of the official docs, as I assume it's for native iOS apps only, and not for flutter, and I don't know where exactly I would have to put that code. I have only added the pod dependency and run pod install.
I don't have a .entitlements file.
So after all those steps, I'm apparently supposed to expect to find a debug token in my run output, as in:
Yet the only relevant output I can find is the following:
Runner[72719:33546579] 10.3.0 - [FirebaseFirestore][I-FST000001] AppCheck failed: 'The operation couldn’t be completed. (com.apple.devicecheck.error error 1.)'
If it matters:
I have NOT YET uploaded my iOS app to apple developer, app store connect or whatever (I'm not yet familiar with the process of publishing to the app store).
Neither have I uploaded my android app to Google Play console or created an app there (for this project).
Don't tell me anything about firestore rules. I already had that set up long ago, and everything worked just fine before I started integrating App Check.
Don't recommend any 3rd party plugins to me, I will only use official ones.
The firebase documentation says:
Tip: Confirm in your Xcode project's build settings that it passes the DEBUG flag to the Swift compiler
Try removing the '#if DEBUG' and '#endif' and run the app.
If it works, it mean you have missed that step
I was not able to find that build setting, so i just removed those lines from the AppDelegate, but i need to keep in mind to remove the other 2 lines while building the release mode
See this answer on the flutterfire Github issues page. Basically, call setAppCheckProviderFactory before GeneratedPluginRegistrant.register(with: self) in the app delegate file. I was investigating the same issue and it fixed it for me (the debug token was instantly printed out in Xcode's debug output). Hope it helps you as well!

Why does my Flutter app crash at startup on iOS?

I'm trying to build a simple app using Flutter for iOS and Android, but the app crashes on startup when I try to run it on an iPhone (Android runs fine). I don't have a mac, so I'm using Codemagic to compile a release build and deploy to TestFlight, then installing on an iPhone from there. Apple only shows their crash logs in Xcode as far as I can tell (nothing in App Store Connect online?), and since I don't have a mac, I can't see those. Any thoughts as to what I might be running into, or what information I can gather to debug the problem?
Thanks!
Edit: I've been digging around some more and it looks like the crash is related to the Firebase dependencies. If I create the Flutter demo project (flutter create ), it runs fine on iOS. However if I then add Firebase packages to pubspec.yaml, and manually add GoogleServices-info.plist, the app crashes on startup. (I'm not adding any code that uses Firebase yet.) GoogleServices-info.plist is supposed to be added with Xcode, but since I don't have Xcode or a mac, that makes it tough. The second answer to this question gives a suggestion: Where to save GoogleService-Info.plist in Flutter without Xcode?
I tried making those changes but got the same result. Anybody have any recommendations for adding Firebase without a mac?
Ok, so here's what happened. Originally the app crashed on iOS because there were issues with the GoogleServices-info.plist file (probably). There were no error messages, so I didn't know where to look. I finally just went back to the simple demo app and started layering things back in to isolate the issue. The demo app would build and run on iOS with no problems, but when I added the Firebase dependencies (as a group), it failed. I had added the GoogleServices-info.plist file manually (outside of Xcode) and adjusted the references in ios/Runner.xcodeproj/project.pbxproj using a text editor, but that didn't do the trick.
At this point I finally broke down and got a MacBook. Debugging on the Mac, I could now see that the app crashed in debug mode on the emulator as well as when in release mode on a device, but still no helpful error messages. I added the GoogleServices-info.plist file using Xcode, so at least that piece was correct, but the app still crashed immediately. Going through the documentation, I realized that when I made the sample app, I had forgotten to add the app ID in the info.plist file for AdMob. At this point it was just AdMob causing the crash, not the other Firebase dependencies. I added that back in and things ran fine. I wish I had looked at that a month ago. Ugh.
Thanks #Mikhail Tokharev and #season for taking a stab at such a vague question. I wish I had more detail to share initially, but I didn't know enough yet to know what could be going wrong.
TL;DR
Just get a Mac. Trying to debug through Codemagic won't work.
For Firebase, be sure you actually add your GoogleServices-info.plist file through Xcode. Trying to add it manually and hack the project.pbxproj file probably won't work (this a practical recommendation, I didn't prove this conclusively).
https://firebase.google.com/docs/flutter/setup?platform=ios#add-config-file
For AdMob, be sure to add your application ID to the info.plist. https://pub.dev/packages/firebase_admob
I've been facing this error since the last few days and I happen to solve it today. So, I would like to share it with anyone facing startup error after connecting their iOS app to firebase.
I had followed all the steps while setting up a new iOS app with firebase and this was what exactly caused the error, in my case. If you have placed import 'Firebase' and Firebase.configure() in your AppDelegate.swift, then remove it and run your app again. I removed those two lines and it worked fine. Test it with Cloud Firestore (just make a button write something to your cloud firestore) and make sure you add await Firebase.initializeApp(); as well when the button is pressed.
I did all of those steps and it worked fine with me.
P.S. I did it with android studio in a Mac.
For any newbies out there like me, make sure registering firebase is before GeneratedPluginRegistrant in your ios/Runner/AppDelegate.swift file.
// This works without crashes, FirebaseApp.configure() after GeneratedPluginRegistrant crashes
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
i had the same issue and i have fixed it as i was new to ios deployment i forgot to add capabilities which indeed crashed my app in testflight ...so please be sure you have added required capabilities in signing and capability tab in xcode
use terminal to run the app.
run this command
flutter run --release
For iOS: In our case this happened because of Facebook plugin update.
Previous version: flutter_facebook_auth: ^3.5.1
New Version: flutter_facebook_auth: ^4.3.3
We were missing FacebookClientToken in Info.plist file. So after adding that it worked.
<key>FacebookClientToken</key>
<string>$(FACEBOOK_CLIENT_TOKEN)</string>
most probably you've faced with next Flutter issue https://github.com/flutter/flutter/issues/54707
I had the same problem and solved it as below :
In the folder of flutter sdk,
I did git pull then run the app again and it was solved .
If you using Google Firebase library in flutter app
Make sure use FirebaseApp.configure() before GeneratedPluginRegistrant.register(with: self) in AppDelegate.swift file.
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)

Fabric not sending data to my dashboard

I set you on situation:
I had a project 1.8.10 Objective C App that was without Fabric Crashlytics. So, when I got control of the project they told me that Fabric was already installed. I checked and yes, everything was good. Still, we updated the app to the 1.9.10 (totally different build number) and we set the itunnes connect deployment in 7 days. At first I believed that was something of Apple, but now we are in 100% and there's no data. Actually, I can't see my new app's version (1.9.10) in Fabric's dashboard.
(https://stackoverflow.com/a/41160905/9684719)
Yes: I have checked missing dYSIM, runscript, plist, at Debug information in my project I have DWARF with dSYM File.
Crashlytics not reporting crash in Release mode
Yes: I have my Fabric instantiation in Apps Delegate fine too.
Fabric doesn't update my latest build version
I can see in Itunes Connect that there is people using my app.

Google Clould Messaging (iOS) put files in default app Documents folder

I would like to turn on UIFileSharingEnabled to let users of my app save some files in their pc.
The problem is that a Google library is putting files inside the main Documents folder of my app without letting me specify a different destination.
This way, if I turn on UIFileSharingEnabled, this is what the user can see and interact with (download or delete!)
The 3 folders are mine, so I can move them out easily, but the 3 .plist files are a problem. I cannot move them without breaking google functionalities.
I use Cocoapods for loading them inside my project.
pod 'Google/Analytics', '1.0.7'
pod 'Google/CloudMessaging', '1.0.7'
Any idea on how to fix this? I'm stuck in this situation.
Thanks
UPDATE: This issue is finally fixed in Firebase version 3.4 from 1 Aug 2016: "plist files used by FIRMessaging are now stored in an ApplicationSupport directory." (source)
Six months later I have the same problem. It turned out GCM developers have failed to fix this bug. I opened another issue (here) and they confirmed this is not fixed yet. In the meantime Google have announced Firebase Cloud Messaging will inherit GCM. I removed GCM form my app and integrated Firebase. However the issue is still reproducible. These four files are created upon app launch:
com.google.iid-keypair.plist
com.google.iid-tokens.plist
g-checkin.plist
rmq2.sqlite
I've logged a bug request to Firebase support. I'll update my answer when I see this issue fixed.
Till then I do not recommend to use Firebase Messaging in an iOS application. Your app may be rejected from the App Store for writing temp files to Documents directory.
Just so you know, I reported the issue on github.
https://github.com/google/gcm/issues/120
Yesterday a Google guy said it will be fixed in the next version! Yeah!

Parse push notifications broken in iOS 9 build with updated frameworks

I'm trying to conceptually understand how I broke my push notifications in iOS 9.
Here's what actions I took:
I updated the Parse and Bolts frameworks from 1.6.1 to 1.8.3 by deleting the old frameworks in Xcode and deleting the actual files in the finder. Then I added the new versions of the frameworks into the project by dragging them into Xcode. I checked the build phases and the new libraries are linked.
At this point I tested the app and was not receiving notifications with this build. People running previous versions of the app on iOS 9 do receive notifications.
I had not changed the App ID or Provisioning Profile at this point, but I thought they could be the issue, so I created a new Provisioning Profile with the existing App ID. Still no notifs.
I checked in Parse Core and my device is registering with the correct build # and the updated Parse library. So Parse knows my device needs to be sent a push, but it's not getting there.
Normally I would expect the advice to be create a new Provisioning Profile, but I did that. Any idea what I might be missing here? Thanks.
Since you did all of that, I would like to note that Push notifications are not guaranteed to be sent, they just usually are. And Parse Push has gone down before. So if not tonight, try again tomorrow. However, I would try a couple more things, ensure your client-push is enabled in your Parse.com console. I would also delete the app and reinstall and also make sure your code signing is accurate in your project settings. You should also try a simple Clean in Xcode, sometimes that does a lot of good. At most, you could try building an Ad Hoc version to test. Lastly, they have summarized a couple of more things you can troubleshoot since this a common issue and they use their Google Groups for developer communications now more-so than SO : https://groups.google.com/forum/#!topic/parse-developers/65WAfRIiEnA
Note: This is not a one-answer fix, since push notifications don't have a one-specific issue. But these are general outlines of what can be done to remedy your particular issue. I have two apps with Parse, running Xcode 7 GM and iOS 9 GM and push notifications are working for both.
Simply using an ad hoc build (ie with production push certificates) rather than deploying from xCode (with development certs) resolved this. If your app is already deployed in production in Parse, you will have replaced the development certs in their dashboard when you released it.

Resources