RN Firebase-Android上的okhttp3版本不匹配

时间:2019-04-28 16:18:49

标签: firebase react-native react-native-android react-native-firebase

尝试将RN与Firebase集成。显然我遇到了下一个错误:

Cannot find a version of 'com.squareup.okhttp3:okhttp' that satisfies the version constraints: 
   Dependency path 'getnow:react-native-firebase:unspecified' --> 'com.facebook.react:react-native:0.57.7' --> 'com.squareup.okhttp3:okhttp:3.11.0'
   Dependency path 'getnow:react-native-firebase:unspecified' --> 'com.google.firebase:firebase-functions:16.3.0' --> 'com.squareup.okhttp3:okhttp:3.12.1'
   Dependency path 'getnow:react-native-firebase:unspecified' --> 'com.facebook.react:react-native:0.57.7' --> 'com.facebook.fresco:imagepipeline-okhttp3:1.10.0' --> 'com.squareup.okhttp3:okhttp:3.10.0'
   Dependency path 'getnow:react-native-firebase:unspecified' --> 'com.facebook.react:react-native:0.57.7' --> 'com.squareup.okhttp3:okhttp-urlconnection:3.11.0' --> 'com.squareup.okhttp3:okhttp:3.11.0'
   Constraint path 'getnow:react-native-firebase:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.11.0' because of the following reason: debugRuntimeClasspath uses version 3.11.0
   Constraint path 'getnow:react-native-firebase:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.11.0' because of the following reason: debugRuntimeClasspath uses version 3.11.0
   Constraint path 'getnow:react-native-firebase:unspecified' --> 'com.squareup.okhttp3:okhttp' strictly '3.11.0' because of the following reason: debugRuntimeClasspath uses version 3.11.0

有人知道如何处理吗? :(

Gradle版本:

classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'

package.json的Firebase版本:

"react-native-firebase": "^5.3.1"

来自build.gradle:

implementation "com.google.android.gms:play-services-base:16.1.0"
implementation "com.google.firebase:firebase-core:16.0.8"

1 个答案:

答案 0 :(得分:1)

只需更改android / build.gradle 从com.android.tools.build:gradle:3.3.2到com.android.tools.build:gradle:3.2.1似乎可以解决此问题...