当我试图在Android Studio中编译我的应用时,我对" React-Native-geolocation-Service"有问题。
Cannot find a version of 'com.android.support:appcompat-v7' that satisfies the version constraints:
Dependency path 'UnalAR:react-native-geolocation-service:unspecified' --> 'com.android.support:appcompat-v7:26.1.0'
Constraint path 'UnalAR:react-native-geolocation-service:unspecified' --> 'com.android.support:appcompat-v7' strictly '26.1.0' because of the following reason: debugRuntimeClasspath uses version 26.1.0
Dependency path 'UnalAR:react-native-geolocation-service:unspecified' --> 'com.android.support:appcompat-v7:26.1.0'
Constraint path 'UnalAR:react-native-geolocation-service:unspecified' --> 'com.android.support:appcompat-v7' strictly '26.1.0' because of the following reason: debugRuntimeClasspath uses version 26.1.0
Dependency path 'UnalAR:react-native-geolocation-service:unspecified' --> 'com.android.support:appcompat-v7:26.1.0'
Constraint path 'UnalAR:react-native-geolocation-service:unspecified' --> 'com.android.support:appcompat-v7' strictly '26.1.0' because of the following reason: debugRuntimeClasspath uses version 26.1.0
Dependency path 'UnalAR:react-native-geolocation-service:unspecified' --> 'com.android.support:appcompat-v7:26.1.0'
Constraint path 'UnalAR:react-native-geolocation-service:unspecified' --> 'com.android.support:appcompat-v7' strictly '26.1.0' because of the following reason: debugRuntimeClasspath uses version 26.1.0
Dependency path 'UnalAR:react-native-geolocation-service:unspecified' --> 'com.android.support:appcompat-v7:26.1.0'
Dependency path 'UnalAR:react-native-geolocation-service:unspecified' --> 'com.facebook.react:react-native:0.57.8' --> 'com.android.support:appcompat-v7:27.1.1'
我的android/app/build.gradle
dependencies {
compile project(':react-native-simple-compass')
compile project(':react-native-heading')
compile project(':react-native-geolocation-service')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.facebook.react:react-native:+'
implementation project(':arcore_client') // remove this if AR not required
implementation project(':gvr_common')
implementation project(path: ':viro_renderer')
implementation project(path: ':react_viro')
implementation 'com.google.android.exoplayer:exoplayer:2.7.1'
implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
implementation 'com.amazonaws:aws-android-sdk-core:2.7.7'
implementation 'com.amazonaws:aws-android-sdk-ddb:2.7.7'
implementation 'com.amazonaws:aws-android-sdk-ddb-mapper:2.7.7'
implementation 'com.amazonaws:aws-android-sdk-cognito:2.7.7'
implementation 'com.amazonaws:aws-android-sdk-cognitoidentityprovider:2.7.7' }
我在此处遵循React-Native-geolocation-Service文档,但是只有当我包括此库时,此错误。
我认为错误在
中实施'com.android.support:appcompat-v7:28.0.0'
,但我害怕改变它。
感谢您的帮助。
您是正确的。查看该项目的代码,看来它检查了您是否在项目中覆盖版本(当这些问题出现时,许多依赖项开始这样做)。因此,进入您的项目build.gradle(不是app/build.gradle),您可以覆盖库使用的版本:
buildscript {
ext {
...
supportLibVersion = "28.0.0"
...
}
}