Я интегрировал аналитику firebase и сбои в реактивном приложении. Аналитическая часть работает нормально.
Но Crashlytics не работает для android, см. Приложение ниже. ![enter image description here](https://i.stack.imgur.com/yqkYe.png)
Для IOS, по крайней мере, что-то показывает на консоли Firebase. ![enter image description here](https://i.stack.imgur.com/bnniz.png)
Вот то, что я вижу в adb logcat для android.
Caused by: java.lang.RuntimeException: Background thread crash
01-06 14:21:47.949 15169 20465 E AndroidRuntime: at com.crashlytics.android.core.CrashTest.throwRuntimeException(CrashTest.java:21)
01-06 14:21:47.949 15169 20465 E AndroidRuntime: at com.crashlytics.android.core.CrashTest$1.doInBackground(CrashTest.java:50)
01-06 14:21:47.949 15169 20465 E AndroidRuntime: at com.crashlytics.android.core.CrashTest$1.doInBackground(CrashTest.java:42)
01-06 14:21:47.949 15169 20465 E AndroidRuntime: at android.os.AsyncTask$3.call(AsyncTask.java:378)
01-06 14:21:47.949 15169 20465 E AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Я пробовал любое другое решение для stackoverflow, но не помогло
android / app / build.gradle
apply plugin: "com.android.application"
apply plugin: "io.fabric"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "*.*.*"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 48
versionName "6.3.15"
multiDexEnabled true
ndk {
abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
missingDimensionStrategy 'react-native-camera', 'general'
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation project(':@react-native-firebase_crashlytics')
implementation project(':@react-native-firebase_app')
implementation project(':@react-native-firebase_analytics')
implementation project(':react-native-network-info')
implementation project(':react-native-camera')
implementation project(':trace-network')
implementation project(':react-native-wmsso')
implementation project(':rn-fetch-blob')
implementation project(':react-native-webview')
implementation project(':react-native-video')
implementation project(':react-native-haptic-feedback')
implementation project(':react-native-gesture-handler')
implementation project(':react-native-device-info')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+"
}
buildscript {
repositories {
google()
maven {
url 'https://maven.google.com'
}
maven { url 'https://maven.fabric.io/public' }
jcenter()
dependencies {
classpath 'com.google.gms:google-services:4.2.0'
}
}
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
buildscript {
repositories {
mavenCentral()
jcenter()
}
}
apply plugin: 'com.google.gms.google-services'
android / build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
dependencies {
classpath("com.android.tools.build:gradle:3.4.0")
classpath 'com.google.gms:google-services:4.3.3'
classpath 'io.fabric.tools:gradle:1.31.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url 'https://maven.google.com'
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}