![](/img/trans.png)
[英]Android Studio could not find any version that matches com.android.support:appcompat-v7:+
[英]Cannot find a version of 'com.android.support:appcompat-v7' that satisfies the version constraints
當我嘗試在 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"
...
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.