mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-13 09:38:53 +08:00
Crashlytics doc update
This commit is contained in:
83
docs/crashlytics/android-setup.md
Normal file
83
docs/crashlytics/android-setup.md
Normal file
@@ -0,0 +1,83 @@
|
||||
---
|
||||
title: Android Setup
|
||||
description: Additional Android steps for Crashlytics integration
|
||||
---
|
||||
|
||||
# Android Setup
|
||||
|
||||
> If you're migrating from Fabric ensure 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.
|
||||
|
||||
## Additional Installation Steps
|
||||
|
||||
### Add Fabric 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."_
|
||||
|
||||
#### Add the Fabric Maven repository
|
||||
|
||||
**`android/build.gradle`**:
|
||||
|
||||
```groovy{6-8}
|
||||
// ..
|
||||
buildscript {
|
||||
// ..
|
||||
repositories {
|
||||
// ..
|
||||
maven {
|
||||
url 'https://maven.fabric.io/public'
|
||||
}
|
||||
}
|
||||
// ..
|
||||
}
|
||||
```
|
||||
|
||||
#### Add the Fabric Tools Plugin dependency
|
||||
|
||||
**`android/build.gradle`**:
|
||||
|
||||
```groovy{6}
|
||||
// ..
|
||||
buildscript {
|
||||
// ..
|
||||
dependencies {
|
||||
// ..
|
||||
classpath 'io.fabric.tools:gradle:1.28.1'
|
||||
}
|
||||
// ..
|
||||
}
|
||||
```
|
||||
|
||||
#### Apply the Fabric Tools Plugin to your app
|
||||
|
||||
**`android/app/build.gradle`**:
|
||||
|
||||
```groovy{2}
|
||||
apply plugin: 'com.android.application' // apply after this line
|
||||
apply plugin: 'io.fabric'
|
||||
// ..
|
||||
```
|
||||
|
||||
#### Enable Crashlytics NDK reporting
|
||||
|
||||
> OPTIONAL
|
||||
|
||||
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.
|
||||
|
||||
**`android/app/build.gradle`**:
|
||||
|
||||
```groovy{4-6}
|
||||
// ..
|
||||
apply plugin: 'io.fabric'
|
||||
// ..
|
||||
crashlytics {
|
||||
enableNdk true
|
||||
}
|
||||
```
|
||||
|
||||
#### Rebuild the project
|
||||
|
||||
Once the above steps have been completed, rebuild your Android project:
|
||||
|
||||
```bash
|
||||
npx react-native run-android
|
||||
```
|
||||
@@ -1,78 +1,9 @@
|
||||
---
|
||||
title: Android Setup
|
||||
title: Android Manual Installation
|
||||
description: Manually integrate Crashlytics into your Android application.
|
||||
---
|
||||
|
||||
# Android Setup
|
||||
|
||||
> If you're migrating from Fabric ensure 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.
|
||||
|
||||
## Additional Installation Steps
|
||||
|
||||
### Add Fabric 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."_
|
||||
|
||||
#### Add the Fabric Maven repository
|
||||
|
||||
**`android/build.gradle`**:
|
||||
|
||||
```groovy{6-8}
|
||||
// ..
|
||||
buildscript {
|
||||
// ..
|
||||
repositories {
|
||||
// ..
|
||||
maven {
|
||||
url 'https://maven.fabric.io/public'
|
||||
}
|
||||
}
|
||||
// ..
|
||||
}
|
||||
```
|
||||
|
||||
#### Add the Fabric Tools Plugin dependency
|
||||
|
||||
**`android/build.gradle`**:
|
||||
|
||||
```groovy{6}
|
||||
// ..
|
||||
buildscript {
|
||||
// ..
|
||||
dependencies {
|
||||
// ..
|
||||
classpath 'io.fabric.tools:gradle:1.28.1'
|
||||
}
|
||||
// ..
|
||||
}
|
||||
```
|
||||
|
||||
#### Apply the Fabric Tools Plugin to your app
|
||||
|
||||
**`android/app/build.gradle`**:
|
||||
|
||||
```groovy{2}
|
||||
apply plugin: 'com.android.application' // apply after this line
|
||||
apply plugin: 'io.fabric'
|
||||
// ..
|
||||
```
|
||||
|
||||
#### Enable Crashlytics NDK reporting
|
||||
|
||||
> OPTIONAL
|
||||
|
||||
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.
|
||||
|
||||
**`android/app/build.gradle`**:
|
||||
|
||||
```groovy{4-6}
|
||||
// ..
|
||||
apply plugin: 'io.fabric'
|
||||
// ..
|
||||
crashlytics {
|
||||
enableNdk true
|
||||
}
|
||||
```
|
||||
# Android Manual Installation
|
||||
|
||||
# Android Manual Linking
|
||||
|
||||
|
||||
32
docs/crashlytics/ios-setup.md
Normal file
32
docs/crashlytics/ios-setup.md
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: iOS Setup
|
||||
description: Additional iOS steps for Crashlytics integration.
|
||||
---
|
||||
|
||||
# iOS Setup
|
||||
|
||||
## Additional Installation Steps
|
||||
|
||||
### Add the Crashlytics run script
|
||||
|
||||
Crashlytics for iOS requires an additional manual step once the NPM package has been installed.
|
||||
You'll need XCode for the following steps.
|
||||
|
||||
Open your project in XCode, and select the project file in the Navigator. Select the 'Build Phases' tab &
|
||||
add a 'New Run Script Phase':
|
||||
|
||||

|
||||
|
||||
In the new build phase, add a new script into the text box:
|
||||
|
||||
```
|
||||
"${PODS_ROOT}/Fabric/run"
|
||||
```
|
||||
|
||||

|
||||
|
||||
Once added, rebuild your project:
|
||||
|
||||
```bash
|
||||
npx react-native run-ios
|
||||
```
|
||||
@@ -1,37 +1,9 @@
|
||||
---
|
||||
title: iOS Setup
|
||||
title: iOS Manual Installation
|
||||
description: Manually integrate Crashlytics into your iOS application.
|
||||
---
|
||||
|
||||
# iOS Setup
|
||||
|
||||
## Additional Installation Steps
|
||||
|
||||
### Add the Crashlytics run script
|
||||
|
||||
Crashlytics for iOS requires an additional manual step once the NPM package has been installed.
|
||||
You'll need XCode for the following steps.
|
||||
|
||||
Open your project in XCode, and select the project file in the Navigator. Select the 'Build Phases' tab &
|
||||
add a 'New Run Script Phase':
|
||||
|
||||

|
||||
|
||||
In the new build phase, add a new script into the text box:
|
||||
|
||||
```
|
||||
"${PODS_ROOT}/Fabric/run"
|
||||
```
|
||||
|
||||

|
||||
|
||||
Once added, rebuild your project:
|
||||
|
||||
```bash
|
||||
npx react-native run-ios
|
||||
```
|
||||
|
||||
## iOS Manual Linking
|
||||
# iOS Manual Installation
|
||||
|
||||
The following steps are only required if your environment does not have access to React Native auto-linking.
|
||||
|
||||
|
||||
@@ -18,6 +18,27 @@ yarn add @react-native-firebase/crashlytics
|
||||
|
||||
> Integrating manually and not via React Native auto-linking? Check the setup instructions for <Anchor version group href="/android">Android</Anchor> & <Anchor version group href="/ios">iOS</Anchor>.
|
||||
|
||||
Both platforms require additional steps to complete installation:
|
||||
|
||||
<Grid columns="2">
|
||||
<Block
|
||||
title="Android: Additional Steps"
|
||||
to="/android-setup"
|
||||
icon="android"
|
||||
color="#4CAF50"
|
||||
>
|
||||
Follow the Android steps to complete Crashlytics integration.
|
||||
</Block>
|
||||
<Block
|
||||
title="iOS: Additional Steps"
|
||||
to="/ios-setup"
|
||||
icon="phone_iphone"
|
||||
color="#2196F3"
|
||||
>
|
||||
Follow the iOS steps to complete Crashlytics integration.
|
||||
</Block>
|
||||
</Grid>
|
||||
|
||||
## Module usage
|
||||
|
||||
The Crashlytics package will automatically report on any fatal application crash. Both native and JavaScript
|
||||
@@ -38,27 +59,6 @@ The package also provides access to the firebase instance:
|
||||
import { firebase } from '@react-native-firebase/crashlytics';
|
||||
```
|
||||
|
||||
Both platforms require additional steps to complete installation:
|
||||
|
||||
<Grid columns="2">
|
||||
<Block
|
||||
title="Android: Additional Steps"
|
||||
to="/android"
|
||||
icon="android"
|
||||
color="#4CAF50"
|
||||
>
|
||||
Follow the Android steps to complete Crashlytics integration.
|
||||
</Block>
|
||||
<Block
|
||||
title="iOS: Additional Steps"
|
||||
to="/ios"
|
||||
icon="phone_iphone"
|
||||
color="#2196F3"
|
||||
>
|
||||
Follow the iOS steps to complete Crashlytics integration.
|
||||
</Block>
|
||||
</Grid>
|
||||
|
||||
### Testing crashes
|
||||
|
||||
The Crashlytics package provides a `crash` method which is provided to ensure crash reports are correctly
|
||||
|
||||
@@ -140,11 +140,15 @@
|
||||
to: '/'
|
||||
- text: Quick Start
|
||||
to: '/quick-start'
|
||||
- group: Additional Steps
|
||||
- text: Additional Android Setup
|
||||
to: '/android-setup'
|
||||
- text: Additional iOS Setup
|
||||
to: '/ios-setup'
|
||||
- group: Manual Installation
|
||||
children:
|
||||
- text: Android Steps
|
||||
- text: Android Installation
|
||||
to: '/android'
|
||||
- text: iOS Steps
|
||||
- text: iOS Installation
|
||||
to: '/ios'
|
||||
|
||||
- module: database
|
||||
|
||||
Reference in New Issue
Block a user