-
Notifications
You must be signed in to change notification settings - Fork 441
Basic integration of Crashlytics for iOS... #549
Conversation
…loads. Based on @hypery2k 's `nativescript-fabric` plugin. Since it is only for iOS right now, both original Firebase `crash_reporting` and `crashlytics` can be enabled. If `crashlytics` is enabled, then `crash_reporting` is disabled for iOS, but still enabled for Android. I prioritized Crashlytics for iOS since the original `crash_reporting` works well enough for Android issues (even with uglify on, but no obfuscation on proguard), but for iOS without dSYM it's almost impossible to decode most of them. The Crashlytics for Firebase offered the easiest solution for automatic dSYM uploading. For Crashlytics dSYM to be properly generated, bitcode must be disabled, which is done via the podfile for all targets. I have this running in Prod with 30,000+ users TODO: implement Android; integrate custom logging
Hi @DickSmith this is awesome! Do you feel like this is ready to be merged? If so, I'll test it and merge to master so we can ship it with release 5.0.0. It will take a little while to get all tasks for 5.0.0 completed, so there is no rush or anything. Thanks, |
@DickSmith this looks great. I could help on this. I currently working on the Android part on my plugin. Should me maybe merge our work somehow? |
If there's anything I can do to help let me know. But perhaps it's easiest to push changes to Dick's fork so all of it ends up in this PR? |
@EddyVerbruggen Yes it appears to be very stable, other than no ability to add the custom logs yet (https://firebase.google.com/docs/crashlytics/customize-crash-reports), which I hadn't been using yet with the original Other than that it is currently building correctly both locally (debug) and on my TravisCI (release with webpack/AoT/uglify; including the automatic dSYM upload), and I currently have 9000 iOS users already using the version with Crashlytics since I released it yesterday with no issues (other than the preexisting crashes that I can now actually make sense of with the symbols 😁 ). I will probably have several thousand more on it by the end of the day, too. @EddyVerbruggen @hypery2k I'm open to whatever works best for you guys. This would have definitely been far more difficult without being able to "borrow" from @hypery2k 's plugin. 😀 The Android I think should be easy enough to add in the Gradle pieces. I haven't looked into uploading the Proguard mappings, although I don't think that is probably as essential for Android as the dSYM is for iOS. I probably use more Proguard than most {N} apps (it's how I avoid @EddyVerbruggen I guess the big question is how we would want to implement the custom logs? Should we just use the same methods for both |
you can take a look at my android branch here
you try yourself with my demo app here and adding
|
…ebase into crashlytics-android # Conflicts: # publish/scripts/installer.js # src/scripts/postinstall.js
@EddyVerbruggen @hypery2k
Tested with both PAN-demo and ng-demo (with and without Crashlytics enabled), as well as in my own ns+ng app. Same as iOS before, if However, getting the same issue as @hypery2k , somewhat different output, but second build works while first doesn't. |
I'm waiting for feedback from @Plamen5kov, see here @DickSmith: Maybe this helps here, too |
Thank you guys for making this. So it should be functional now with TNS >= 3.4? |
no, it's currently having issues, see here. I can not solve the class path issue for now. So currently not able to fix |
@DickSmith Yeah nasty issue that one. Awesome that this will actually report an issue like that! So you think it's ready for prime time? |
@DickSmith So is currently iOS and Android working for you? I still struggling on my nativescript-fabric plugin with the Android Build and I currently think I should quit my plugin in favour to integrate all in the firebase plugin |
``` ERROR Error: Uncaught (in promise): Error: java.lang.IllegalStateException: GoogleApiClient is not connected yet. com.google.android.gms.common.api.internal.zzba.zze(Unknown Source) com.google.android.gms.auth.api.signin.internal.zze.zzb(Unknown Source) com.google.android.gms.auth.api.signin.internal.zzc.revokeAccess(Unknown Source) com.tns.Runtime.callJSMethodNative(Native Method) com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088) com.tns.Runtime.callJSMethodImpl(Runtime.java:970) com.tns.Runtime.callJSMethod(Runtime.java:957) com.tns.Runtime.callJSMethod(Runtime.java:941) com.tns.Runtime.callJSMethod(Runtime.java:933) com.tns.gen.java.lang.Object_frnal_ts_helpers_l58_c38__ClickListenerImpl.onClick(Object_frnal_ts_helpers_l58_c38__ClickListenerImpl.java:12) android.view.View.performClick(View.java:5637) android.view.View$PerformClick.run(View.java:22429) android.os.Handler.handleCallback(Handler.java:751) android.os.Handler.dispatchMessage(Handler.java:95) android.os.Looper.loop(Looper.java:154) android.app.ActivityThread.main(ActivityThread.java:6119) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Error: java.lang.IllegalStateException: GoogleApiClient is not connected yet. com.google.android.gms.common.api.internal.zzba.zze(Unknown Source) com.google.android.gms.auth.api.signin.internal.zze.zzb(Unknown Source) com.google.android.gms.auth.api.signin.internal.zzc.revokeAccess(Unknown Source) com.tns.Runtime.callJSMethodNative(Native Method) com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088) com.tns.Runtime.callJSMethodImpl(Runtime.java:970) com.tns.Runtime.callJSMethod(Runtime.java:957) com.tns.Runtime.callJSMethod(Runtime.java:941) com.tns.Runtime.callJSMethod(Runtime.java:933) com.tns.gen.java.lang.Object_frnal_ts_helpers_l58_c38__ClickListenerImpl.onClick(Object_frnal_ts_helpers_l58_c38__ClickListenerImpl.java:12) android.view.View.performClick(View.java:5637) android.view.View$PerformClick.run(View.java:22429) android.os.Handler.handleCallback(Handler.java:751) android.os.Handler.dispatchMessage(Handler.java:95) android.os.Looper.loop(Looper.java:154) android.app.ActivityThread.main(ActivityThread.java:6119) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) at file:///data/data/__REDACTED__/files/app/tns_modules/nativescript-plugin-firebase/firebase.js:799:70 at new ZoneAwarePromise (file:///data/data/__REDACTED__/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:777:29) at Object.firebase_common_1.firebase.logout (file:///data/data/__REDACTED__/files/app/tns_modules/nativescript-plugin-firebase/firebase.js:795:12) ... ```
How much of this changes with the out of beta announcement? https://firebase.googleblog.com/2018/03/firebase-crashlytics-graduates-from-beta.html |
@EddyVerbruggen @hypery2k @sitefinitysteve @EddyVerbruggen I'll post another PR in the coming weeks that will include the full removal of the old I still have a branch with the Android changes I had been working on, so I should be able to pick up where I left off easily enough, but it may still take some massaging to get it to work. I am also not sure if the changes coming in If you have any questions, feel free to send me a message on the {N} Slack, where my username is also |
@EddyVerbruggen If you want I can revert it and submit it in another PR, or leave it. |
@DickSmith You can leave it in here, I'll be merging it as soon as I've finished a few other things. Won't be too long. Thanks so much for your work and perseverance! |
@DickSmith This seems to work perfectly fine indeed! Just curious: I have no idea how one could verify whether or not those dSYM files are actually uploaded and used in the firebase console. I can force a crash just fine and it turns up in the Firebase console after the app is restarted and Firebase.init runs... but how can you tell those dSYM files are applied? |
did you have a preview build of the plugin? I could verify it in our beta test setup |
@EddyVerbruggen @hypery2k If you want I could send you the |
@DickSmith Yep, I see the former so it's working 😍 @hypery2k I was just chatting with @DickSmith on Slack while narrowing down what causes the crash on Android in both your Fabric plugin and this one (as I was working on adding the Android side of Crsahlytics to Firebase today). The good news: found it! 🎉 The bad news: both our plugins need an ugly build step to copy the Android runtime I can't tell for sure this is the cause, I only see the symptom. But that symptom will be cured by a build step which I can also PR to the Fabric plugin if you like. |
great for the hint. Feel free to send a PR in this branch. Glad for your support |
…k in case Crashlytics is disabled)
...including automatic dSYM uploads. Based on @hypery2k 's
nativescript-fabric
plugin.Since it is only for iOS right now, both original Firebase
crash_reporting
andcrashlytics
can be enabled. Ifcrashlytics
is enabled, thencrash_reporting
is disabled for iOS, but still enabled for Android.I prioritized Crashlytics for iOS since the original
crash_reporting
works well enough for Android issues (even with uglify on, but no obfuscation on proguard), but for iOS without dSYM it's almost impossible to decode most of them. The Crashlytics for Firebase offered the easiest solution for automatic dSYM uploading. For Crashlytics dSYM to be properly generated, bitcode must be disabled, which is done via the podfile for all targets.I have this running in Prod with 30,000+ daily users.
TODOs: implement Android; integrate custom logging