Crashlytics doc update

This commit is contained in:
ehesp
2019-10-01 19:01:43 +01:00
parent a0491a4f46
commit 1f2ee86d80
6 changed files with 147 additions and 125 deletions

View 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
```

View File

@@ -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

View 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':
![Run Script](https://prismic-io.s3.amazonaws.com/invertase%2F96f32c96-0aca-4054-bf30-bd2448ca2462_new+project.png)
In the new build phase, add a new script into the text box:
```
"${PODS_ROOT}/Fabric/run"
```
![Script](https://prismic-io.s3.amazonaws.com/invertase%2Ff06cf5b3-884e-4cbc-8c3d-81072a254f1d_new+project+%281%29.png)
Once added, rebuild your project:
```bash
npx react-native run-ios
```

View File

@@ -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':
![Run Script](https://prismic-io.s3.amazonaws.com/invertase%2F96f32c96-0aca-4054-bf30-bd2448ca2462_new+project.png)
In the new build phase, add a new script into the text box:
```
"${PODS_ROOT}/Fabric/run"
```
![Script](https://prismic-io.s3.amazonaws.com/invertase%2Ff06cf5b3-884e-4cbc-8c3d-81072a254f1d_new+project+%281%29.png)
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.

View File

@@ -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

View File

@@ -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