Android 添加滑动依赖项时出现问题

Android 添加滑动依赖项时出现问题,android,android-gradle-plugin,build.gradle,android-glide,Android,Android Gradle Plugin,Build.gradle,Android Glide,当我添加Glide依赖项时,我用android和java编写了一个程序 dependencies { implementation 'com.android.support:support-vector-drawable:27.1.1' } 实现'com.github.bumptech.glide:glide:4.9.0' annotationProcessor'com.github.bumptech.glide:compiler:4.9.0' 我的android studio开始出现

当我添加Glide依赖项时,我用android和java编写了一个程序

dependencies {
    implementation 'com.android.support:support-vector-drawable:27.1.1'
}
实现'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor'com.github.bumptech.glide:compiler:4.9.0'

我的android studio开始出现以下错误:

“错误:未能解析:支持片段 受影响的模块:应用程序

错误:未能解决:动画向量可绘制 受影响的模块:应用程序“

这是我的应用程序bulid.gradle,显示错误

上周,我寻找了类似的答案,并尝试了所有答案,但我无法解决这个问题, 当我移除滑动依赖项时,一切又恢复正常

这是我的应用程序模块构建。gradle:

    apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.example.mohammad.kahgle"
    minSdkVersion 21
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}    
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.github.armcha:ElasticView:0.1.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.nightonke:boommenu:2.1.1'
implementation 'com.ramotion.foldingcell:folding-cell:1.2.2'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation "com.android.support:support-core-utils:28.0.0"
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

在您的应用程序模块中启用vectorDrawables useSupportLibrary

android {
    compileSdkVersion 27
    defaultConfig {
        ....
        vectorDrawables.useSupportLibrary = true
    }
}
然后将其添加到依赖项中

dependencies {
    implementation 'com.android.support:support-vector-drawable:27.1.1'
}

将其添加到build.gradle文件中。有关详细信息,请参阅的下载部分

使用以下命令:

 implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation group: 'androidx.fragment', name: 'fragment', version: '1.1.0'
implementation group: 'androidx.vectordrawable', name: 'vectordrawable-animated', version: '1.1.0'

解决方案是删除
~/.gradle
中的caches文件夹,然后再次下载依赖项

加:


app/gradle

解决minsdkversion 21和targetsdkversion 29中的此问题,请使用以下库:

将这些添加到依赖项:

implementation 'androidx.fragment:fragment:1.2.0-rc04'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
并将glide版本降级至4.8.0

implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'

我有这个问题。如果不将动画矢量drawable与glide一起使用,请使用以下代码排除无用的依赖项:

implementation ("com.github.bumptech.glide:glide:4.9.0"){
    exclude group: 'androidx.vectordrawable', module: 'vectordrawable-animated'
}

快乐编码:)

你可以发布你的应用程序模块build.gradle你已经有了
defaultConfig{vectorDrawables.useSupportLibrary=true}
?@dardardar我把它添加到question@ADM是和否更改在glide Dependency中尝试
kapt
而不是
annotationProcessor
,我这样做了,也得到了这个错误:未能解决:支持向量可绘制受影响的模块:应用你在构建中把它放在哪里了。gradle?我不明白。是的,我以前是这样做的,在互联网上没有适合我的解决方案
implementation ("com.github.bumptech.glide:glide:4.9.0"){
    exclude group: 'androidx.vectordrawable', module: 'vectordrawable-animated'
}