gpt4 book ai didi

firebase - 安装 Pushwoosh 包后 React Native 应用程序关闭

转载 作者:行者123 更新时间:2023-12-02 10:18:41 24 4
gpt4 key购买 nike

我在一个干净的应用程序中测试了该包,它工作正常,但是当我尝试将 pushwoosh-react-native-plugin 添加到现有应用程序时,它会在启动时关闭并且不会引发错误在 Firebase 崩溃报告中。

我怀疑可能与 react-native-google-analytics-bridgereact-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
}

最佳答案

我刚刚按照本文详细介绍的具体步骤修复了错误:https://medium.com/@suchydan/how-to-solve-google-play-services-version-collision-in-gradle-dependencies-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
}

关于firebase - 安装 Pushwoosh 包后 React Native 应用程序关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47478437/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com