【发布时间】:2019-01-26 12:30:46
【问题描述】:
当我尝试构建应用程序时,它在构建选项卡上给了我这个错误
找到多个文件,其独立于操作系统的路径为“META-INF/androidx.exifinterface_exifinterface.version”
而且我没有在我的任何模块中使用 AndroidX
我也将此添加到我的build.gradle
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/proguard/androidx-annotations.pro'
}
dependencies
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.android.support:design:$supportLibraryVersion"
implementation "com.android.support:cardview-v7:$supportLibraryVersion"
implementation "com.android.support:exifinterface:$supportLibraryVersion"
implementation "com.android.support:support-media-compat:$supportLibraryVersion"
implementation "com.android.support:support-v4:$supportLibraryVersion"
}
【问题讨论】:
-
Build error when migrate to androidX你没有。您仍然使用旧的支持库依赖项。首先转到菜单 Refactor > Migrate to AndroidX。完成后,如果您仍有问题,请返回此处并更新您的问题。
标签: android gradle android-gradle-plugin build.gradle androidx