繁体   English   中英

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

[英]issue while adding glide dependencies

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

implementation 'com.github.bumptech.glide:glide:4.9.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'

我的 android studio 开始给我这个错误:

“错误:无法解决:支持片段受影响的模块:应用程序

错误:无法解决:动画矢量绘制受影响的模块:应用程序”

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

过去一周我寻找任何类似的答案并尝试所有答案,但我无法解决这个问题,当我删除 Glide 依赖项时,一切又恢复正常。

这是我的应用模块 build.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'
}

我遇到了这个问题。 如果您不使用带有 glide 的动画矢量可绘制,请使用此代码来排除无用的依赖项:

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

快乐编码:)

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

将这些添加到依赖项中:

implementation 'androidx.fragment:fragment:1.2.0-rc04'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'

并将滑翔版本降级到 4.8.0

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

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

repositories {
  mavenCentral()
  google()
}

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

android {
    compileSdkVersion 27
    defaultConfig {
        ....
        vectorDrawables.useSupportLibrary = true
    }
}

然后在依赖项中添加这个

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

用这个 :

 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文件夹,重新下载依赖。

添加:

 implementation 'androidx.fragment:fragment:1.2.0-alpha04' 
 implementation 'androidx.vectordrawable:vectordrawable:1.1.0' 
 implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0' 

app/gradle

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM