Firebase crashlytics android anr

Crashlytics — Android Setup

Additional Android steps for Crashlytics integration

If you’re migrating from Fabric, make sure you remove the fabric.properties file from your Android project. If you do not do this you will not receive crash reports on the Firebase console.

If you’re using Expo, make sure to add the @react-native-firebase/crashlytics config plugin to your app.json or app.config.js . It handles the below installation steps for you. For instructions on how to do that, view the Expo installation section.

Adding Firebase Crashlytics Gradle Tools

These steps are required, if you do not add these your app will most likely crash at startup with the following Error:

«The Crashlytics build ID is missing. This occurs when Crashlytics tooling is absent from your app’s build configuration. Please review Crashlytics onboarding instructions and ensure you have a valid Crashlytics account.» _

1. Add the Google repository (if it’s not there already)

Add the following line to the android/build.gradle file :

2. Add the Firebase Crashlytics Plugin dependency

Add the following dependency to the android/build.gradle file:

3. Apply the Firebase Crashlytics Plugin to your app

Apply the com.google.firebase.crashlytics plugin by adding the following to the top of your android/app/build.gradle file:

4. (Optional) Enable Crashlytics NDK reporting

Crashlytics NDK reporting allows you to capture Native Development Kit crashes, e.g. in React Native this will capture crashes originating from the Yoga layout engine.

Add the firebaseCrashlytics block line to the android/app/build.gradle file:

5. Rebuild the project

Once the above steps have been completed, rebuild your Android project:

To create advanced custom local notifications in React Native; check out our free and open source Notifee library.

Copyright © 2017-2020 Invertase Limited. Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. Some partial documentation, under the Creative Commons Attribution 3.0 License, may have been sourced from Firebase.

All product names, logos, and brands are property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.

Источник

Integrate Firebase Crashlytics In Android

Aug 2, 2020 · 4 min read

Firebase Crashlytics is a real-time crash reporting tool. It helps by automatically collecting, analyzing, and organizing your crash reports.

Читайте также:  Как отправить скриншот с андроида

It also helps you understand which issues are most important, so you can priorities those first and keep your users happy. It combines a real-time dashboard and alerts to keep you aware of your newest issues and any sudden changes instability.

Create a Firebase Project and Add to Android

The first step we need to take is to cre a te a Firebase project and add it to our Android app. At this point, I’ve already created a Firebase project, added it to a new project, and also included the Google Play Service JSON file. If you’re not familiar with this process, you can check out the official guide below.

Add Firebase to your Android project

Install or update Android Studio to its latest version. Make sure that your project meets these requirements: Targets…

Let’s get Started

The Google Services plugin uses a Google Services JSON file to configure your application to use Firebase. And the Crashlytics dependencies allow you to integrate the Crashlytics SDK into your app.

Step1: Add the Firebase plugin to your app

First thing first, we need to add a firebase classpath In our project-level build.gradle file, like the below code snippet:

In your app-level build.gradle file, apply the Crashlytics Gradle plugin.

Step 2: Add Dependency

Now, we need to add a firebase crashlytics dependency on our Android project in the build.gradle file. To use the Crashlytics features, these are the dependencies we need:

Note: At the time of writing, the latest firebase-crashlytics version was 17.1.1 but you can use any latest stable release you want from MVN Repository.

Sync the Project

After successfully adding the dependency, just sync the project, as shown in the screenshot below:

Step 3: Initialize Crashlytics

Google recommends adding the Firebase SDK for Google Analytics to your app in addition to the Firebase Crashlytics SDK. Make sure you add Google Analytics version 17.2.3 or later in order to get real-time crashes.

Step 4: Run Your Project

Finally, we have successfully Integrated the Firebase Crashlytics in our project, Your device logs display the Firebase verification that initialization is complete.

Other Interesting Tools

There are so many other bug reporting tools as well, one I would like to share with you all is Shake.

Shake is a bug reporting SDK for iOS and Android apps. It’s a powerful tool that easily compares to other bug reporting tools like Instabug or Crashlytics.

With Shake SDK added to your app, your testers can report any bug in under 5 seconds. It will take all the extra info you as a developer need and send it to the Shake web dashboard.

Shake SDK automatically captures the following information:

  • Tester’s device model
  • App and OS version
  • Current View
  • History of taps
  • Carrier and WiFi details
  • CPU and memory usage
  • List of granted permissions
  • Screen resolution, screen orientation, and pixel density

Источник

ANR During Firebase crashlytics uncaughtException #1741

Comments

krissGit commented Jul 1, 2020

Hi Team,
I have migrated from fabric to Firebase Crashlytics version using version 17.0.0, As per doc
https://firebase.google.com/docs/crashlytics/get-started?platform=android
To test throw new RuntimeException(«Test Crash»);
During testing Main thread is getting blocked leading towards ANR.
Below is ANR logs
### «main» prio=5 tid=1 Blocked
| group=»main» sCount=1 dsCount=0 flags=1 obj=0x746c2a48 self=0x7e4697014c00
| sysTid=9206 nice=-10 cgrp=default sched=0/0 handle=0x7e471c8fd548
| state=S schedstat=( 8688225491 992173020 4523 ) utm=768 stm=100 core=2 HZ=100
| stack=0x7ffc6f1e7000-0x7ffc6f1e9000 stackSize=8MB
| held mutexes=
at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(com.google.firebase:firebase-crashlytics@@17.0.0:-1)
— waiting to lock (a com.google.firebase.crashlytics.internal.common.CrashlyticsController) held by thread 21
at
com.google.firebase.crashlytics.internal.common.CrashlyticsController$5.onUncaughtException(com.google.firebase:firebase-crashlytics@@17.0.0:365)
at com.google.firebase.crashlytics.internal.common.CrashlyticsUncaughtExceptionHandler.uncaughtException(com.google.firebase:firebase-crashlytics@@17.0.0:54)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
at java.lang.Thread.dispatchUncaughtException(Thread.java:1955)

Читайте также:  Quest navigator qsp android

### «com.google.firebase.crashlytics.startup1» prio=5 tid=21 Waiting
| group=»main» sCount=1 dsCount=0 flags=1 obj=0x15c414b0 self=0x7e468dc66400
| sysTid=9245 nice=10 cgrp=default sched=0/0 handle=0x7e467d5f74f0
| state=S schedstat=( 10660500 10578325 35 ) utm=1 stm=0 core=3 HZ=100
| stack=0x7e467d4f4000-0x7e467d4f6000 stackSize=1041KB
| held mutexes=
at java.lang.Object.wait(Native method)

  • waiting on (a java.lang.Object)
    at java.lang.Thread.parkFor$(Thread.java:2137)
  • locked (a java.lang.Object)
    at sun.misc.Unsafe.park(Unsafe.java:358)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:868)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1021)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1328)
    at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:232)
    at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(com.google.firebase:firebase-crashlytics@@17.0.0:185)
    at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(com.google.firebase:firebase-crashlytics@@17.0.0:447)
  • locked (a com.google.firebase.crashlytics.internal.common.CrashlyticsController)
    at com.google.firebase.crashlytics.internal.common.CrashlyticsController$5.onUncaughtException(com.google.firebase:firebase-crashlytics@@17.0.0:365)
    at com.google.firebase.crashlytics.internal.common.CrashlyticsUncaughtExceptionHandler.uncaughtException(com.google.firebase:firebase-crashlytics@@17.0.0:54)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
    at java.lang.Thread.dispatchUncaughtException(Thread.java:1955)

### «com.google.firebase.crashlytics.startup1» prio=5 tid=21 Waiting
What is reason of putting lock on Object by startup1 thread

Thank you
Krishna

The text was updated successfully, but these errors were encountered:

Источник

Get started with Firebase Crashlytics

iOS+ Android Unity

This quickstart describes how to set up Firebase Crashlytics in your app with the Firebase Crashlytics SDK so that you can get comprehensive crash reports in the Firebase console.

Setting up Crashlytics requires tasks both in the Firebase console and your IDE (like adding a Firebase configuration file and the Crashlytics SDK). To finish setup, you’ll need to force a test crash to send your first crash report to Firebase.

Before you begin

If you haven’t already, add Firebase to your Apple project. If you don’t have an Apple app, you can download a sample app.

Recommended: To get features like crash-free users, breadcrumb logs, and velocity alerts, you need to enable Google Analytics in your Firebase project.

If your existing Firebase project doesn’t have Google Analytics enabled, you can enable Google Analytics from the Integrations tab of your in the Firebase console.

If you’re creating a new Firebase project, enable Google Analytics during the project creation workflow.

Step 1: Enable Crashlytics in the Firebase console

Go to the Crashlytics dashboard in the Firebase console.

Make sure your app is selected from the dropdown next to Crashlytics at the top of the page.

Click Enable Crashlytics.

Step 2: Add the Firebase Crashlytics SDK to your app

Use Swift Package Manager to install and manage Firebase dependencies.

Visit our installation guide to learn about the different ways you can add Firebase SDKs to your Apple project, including importing frameworks directly and using CocoaPods.

  1. In Xcode, with your app project open, navigate to File > Swift Packages > Add Package Dependency.
  2. When prompted, add the Firebase Apple platforms SDK repository: Note: New projects should use the default (latest) SDK version, but you can choose an older version if needed.
  3. Choose the Crashlytics library.
  4. For an optimal experience with Crashlytics, we recommend enabling Google Analytics in your Firebase project and adding the Firebase SDK for Google Analytics to your app. You can select either the library without IDFA collection or with IDFA collection.
  5. When finished, Xcode will automatically begin resolving and downloading your dependencies in the background.
Читайте также:  Андроид для тойота хайлендер 2012

Next, configure the Firebase module:

Import the Firebase module in your UIApplicationDelegate :

Swift

Objective-C

Configure a FirebaseApp shared instance, typically in your app’s application:didFinishLaunchingWithOptions: method:

Swift

Objective-C

Step 4: Force a test crash to finish setup

To finish setting up Crashlytics and see initial data in the Crashlytics dashboard of the Firebase console, you need to force a test crash.

And that’s it! Crashlytics is now monitoring your app for crashes. Visit the Crashlytics dashboard to view and investigate all your reports and statistics.

Next steps

  • Customize your crash report setup by adding opt-in reporting, logs, keys, and tracking of non-fatal errors.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Источник

Firebase crashlytics android anr

Get clear, actionable insight into app issues with this powerful crash reporting solution for Apple, Android, and Unity.

Firebase Crashlytics is a lightweight, realtime crash reporter that helps you track, prioritize, and fix stability issues that erode your app quality. Crashlytics saves you troubleshooting time by intelligently grouping crashes and highlighting the circumstances that lead up to them.

Find out if a particular crash is impacting a lot of users. Get alerts when an issue suddenly increases in severity. Figure out which lines of code are causing crashes.

Key capabilities

Curated crash reports Crashlytics synthesizes an avalanche of crashes into a manageable list of issues, provides contextual information, and highlights the severity and prevalence of crashes so you can pinpoint the root cause faster.
Cures for the common crash Crashlytics offers Crash Insights, helpful tips that highlight common stability problems and provide resources that make them easier to troubleshoot, triage, and resolve.
Integrated with Analytics Crashlytics can capture your app’s errors as app_exception events in Analytics. The events simplify debugging by giving you access a list of other events leading up to each crash, and provide audience insights by letting you pull Analytics reports for users with crashes.
Realtime alerts Get realtime alerts for new issues, regressed issues, and growing issues that might require immediate attention.

Implementation path

Connect your app Start by adding Firebase to your app in the Firebase console.
Integrate the SDK Add the Crashlytics SDK via CocoaPods or Gradle, and Crashlytics starts collecting reports.
Check reports in the Firebase console Visit the Firebase console to track, prioritize, and fix issues in your app.

Next steps

Get started with Firebase Crashlytics — Learn how to add Firebase Crashlytics to an Apple, Android, or Unity project.

Customize your crash report setup by adding opt-in reporting, logs, keys, and tracking of non-fatal errors.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Источник

Оцените статью