Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/184.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 找不到';support:supportcompat';满足版本约束的_Android_Build.gradle - Fatal编程技术网

Android 找不到';support:supportcompat';满足版本约束的

Android 找不到';support:supportcompat';满足版本约束的,android,build.gradle,Android,Build.gradle,我正在使用一个内部库。由于库的原因,我的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' --&

我正在使用一个内部库。由于库的原因,我的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'
}


你说得对。看到该项目的代码,它似乎会检查您是否正在覆盖项目中的版本(许多依赖项在出现这些问题时开始这样做)。因此,进入您的项目
build.gradle
(而不是
app/build.gradle
),您可以覆盖库正在使用的版本:

buildscript {
    ext {
        ...
        supportLibVersion = "28.0.0"
        ...
    }
}

firebase jobdispatcher似乎已弃用,并且不会收到其依赖项的任何更新。查看他们的迁移指南:
firebase jobdispatcher
已被弃用。尝试将其迁移到
WorkManager
。检查:现在是迁移的时候了,请使用此迁移androidx进行检查