我在干净的应用程序中测试了软件包,但是当我尝试添加 pusphwoosh-react-react-native-plugin 时,它可以一开始关闭,从不发射Firebase崩溃报告中的错误。
我怀疑可能与 React-Native-Google-Analytics-Bridge 或 React-native-native-firebase 软件包发生冲突,但不能罚款。
该应用在Android和iPhone模拟器中崩溃。
这是我的packages.json 文件的内容:
{
"name": "Myapp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"MD5": "^1.3.0",
"moment": "^2.18.1",
"native-base": "^2.3.2",
"pushwoosh-react-native-plugin": "^3.1.0",
"react": "16.0.0-alpha.12",
"react-native": "0.48.3",
"react-native-fetch-blob": "^0.10.8",
"react-native-firebase": "^3.0.3",
"react-native-google-analytics-bridge": "^5.3.3",
"react-native-htmlview": "^0.12.0",
"react-native-img-cache": "^1.4.0",
"react-native-offline": "^3.1.1",
"react-native-progress": "^3.4.0",
"react-native-timeago": "^0.3.0",
"react-native-video": "^2.0.0",
"react-navigation": "^1.0.0-beta.11",
"rn-placeholder": "^1.0.1"
},
"devDependencies": {
"babel-jest": "21.0.2",
"babel-preset-react-native": "4.0.0",
"jest": "21.1.0",
"react-test-renderer": "16.0.0-alpha.12"
},
"jest": {
"preset": "react-native"
}
}
这是我的 android/build.gradle 中的依赖项:
dependencies {
compile (project(':pushwoosh-react-native-plugin'))
{
exclude group: 'com.google.android.gms'
}
compile (project(':react-native-google-analytics-bridge'))
{
exclude group: 'com.google.android.gms'
}
compile(project(':react-native-firebase')) {
transitive = false
exclude group: 'com.google.android.gms'
}
compile ("com.google.android.gms:play-services-base:11.4.2"){
force = true;
}
compile("com.google.android.gms:play-services-analytics:11.4.2"){
force = true
}
compile ("com.google.firebase:firebase-core:11.4.2"){
force = true;
}
compile 'com.google.firebase:firebase-crash:11.4.2'
compile "com.google.firebase:firebase-analytics:11.4.2"
compile project(':react-native-fetch-blob')
compile project(':react-native-video')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:26.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
我只是在本文中详细介绍的确切步骤之后修复了错误:碰撞中依赖性依赖性-EF086AE5C75F添加此行:
compile("com.google.android.gms:play-services-gcm:11.4.2"){
force = true
}
compile("com.google.android.gms:play-services-location:11.4.2"){
force = true
}
这是我的最终 android/app/build.gradle
dependencies {
compile (project(':pushwoosh-react-native-plugin'))
{
exclude group: 'com.google.android.gms'
}
compile (project(':react-native-google-analytics-bridge'))
{
exclude group: 'com.google.android.gms'
}
compile(project(':react-native-firebase')) {
transitive = false
exclude group: 'com.google.android.gms'
}
compile ("com.google.android.gms:play-services-base:11.4.2"){
force = true;
}
compile("com.google.android.gms:play-services-analytics:11.4.2"){
force = true
}
compile("com.google.android.gms:play-services-gcm:11.4.2"){
force = true
}
compile("com.google.android.gms:play-services-location:11.4.2"){
force = true
}
compile ("com.google.firebase:firebase-core:11.4.2"){
force = true;
}
compile 'com.google.firebase:firebase-crash:11.4.2'
compile "com.google.firebase:firebase-analytics:11.4.2"
compile project(':react-native-fetch-blob')
compile project(':react-native-video')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:26.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}