![](/img/trans.png)
[英]Required by:project :react-native-maps Cannot find a version of 'com.android.support:support-compat' that satisfies the version constraints
[英]Cannot find a version of 'com.android.support:support-compat' that satisfies the version constraints
我正在使用內部庫。 由於庫的原因,我的 android gradle 構建失敗並出現以下問題。
Cannot find a version of 'com.android.support:support-compat' that satisfies the version constraints:
Dependency path 'Project:library:unspecified' --> 'com.firebase:firebase-jobdispatcher:0.8.5' --> 'com.android.support:support-compat:25.0.0'
Constraint path 'Project:library:unspecified' --> 'com.android.support:support-compat:{strictly 25.0.0}' because of the following reason: debugRuntimeClasspath uses version 25.0.0
Dependency path 'Project:library:unspecified' --> 'com.github.bumptech.glide:glide:4.9.0' --> 'com.android.support:support-fragment:27.1.1' --> 'com.android.support:support-compat:27.1.1'
Dependency path 'Project:library:unspecified' --> 'com.github.bumptech.glide:glide:4.9.0' --> 'com.android.support:support-fragment:27.1.1' --> 'com.android.support:support-core-ui:27.1.1' --> 'com.android.support:support-compat:27.1.1'
Dependency path 'Project:library:unspecified' --> 'com.github.bumptech.glide:glide:4.9.0' --> 'com.android.support:support-fragment:27.1.1' --> 'com.android.support:support-core-utils:27.1.1' --> 'com.android.support:support-compat:27.1.1'
Dependency path 'Project:library:unspecified' --> 'com.github.bumptech.glide:glide:4.9.0' --> 'com.android.support:animated-vector-drawable:27.1.1' --> 'com.android.support:support-vector-drawable:27.1.1' --> 'com.android.support:support-compat:27.1.1'
早些時候它使用支持庫:
implementation 'com.android.support:appcompat-v7:27.1.1'
現在它被移動到androidx:
implementation 'androidx.appcompat:appcompat:1.0.0'
庫的build.gradle文件為:
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'
buildscript {
repositories {
jcenter()
google()
mavenCentral()
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.9.1"
}
}
android {
compileSdkVersion 27
defaultConfig {
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "int", "DB_VERSION", "10"
}
buildTypes {
release {
minifyEnabled false
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly 'com.squareup.retrofit2:retrofit:2.4.0'
compileOnly 'com.squareup.retrofit2:converter-gson:2.4.0'
compileOnly 'com.squareup.retrofit2:converter-scalars:2.4.0'
debugImplementation 'com.squareup.okhttp3:logging-interceptor:4.1.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'androidx.appcompat:appcompat:1.0.0'
compileOnly 'com.github.bumptech.glide:glide:4.9.0'
debugImplementation 'com.facebook.stetho:stetho-okhttp3:1.5.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
}
你是對的。 查看該項目的代碼,它似乎會檢查您是否正在覆蓋項目中的版本(當這些問題出現時,許多依賴項開始這樣做)。 所以 go 進入您的項目build.gradle
(不是app/build.gradle
),您可以覆蓋該庫正在使用的版本:
buildscript {
ext {
...
supportLibVersion = "28.0.0"
...
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.