android-studio - 如何修复“在Android中发现多个文件与操作系统无关路径'META-INF/DEPENDENCIES'错误
问题描述
我正在迁移到 google drive api v3 并根据此示例更新依赖项,如下所示:
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.http-client:google-http-client-gson:1.26.0'
implementation('com.google.api-client:google-api-client-android:1.26.0') {
exclude group: 'org.apache.httpcomponents'
}
implementation('com.google.apis:google-api-services-drive:v3-rev136-1.25.0') {
exclude group: 'org.apache.httpcomponents'
}
但我面临这个错误:
发现多个文件的操作系统独立路径为“META-INF/DEPENDENCIES”
并且无法运行该应用程序
解决方案
使用packagingOptions
pickFirst
或exclude
;认为应该保存以排除它:
android {
packagingOptions {
// pickFirst "META-INF/DEPENDENCIES"
exclude "META-INF/DEPENDENCIES"
}
}
1.25.0
和之间似乎也存在版本不匹配1.26.0
。当前版本是:
implementation "com.google.apis:google-api-services-drive:v3-rev173-1.25.0"
其他人可能也需要 version 1.25.0
。
推荐阅读
- css - Firefox 点击后突然显示焦点轮廓。单击后如何避免轮廓但将其留给键盘焦点?
- docker - 在容器中找不到`/etc/letsencrypt/live/`
- android - 是否可以在 Android 10 及更高版本上从路径(外部存储)将图像设置为 ImageView?
- c# - C# form.show() 不在计时器中运行
- node.js - 如何使用 ESlint 修复我的 Node.js 语法?
- javascript - 弹出窗口关闭时如何重置javascript游戏
- android - Android:将从前台服务接收到的数据显示到活动内的 MapView 上
- javascript - 如何在 AGGrid 初始化后更改 floatingFilter 选项?
- wso2 - WSO2 身份服务器 - 禁用不区分大小写的用户名
- video - 如何将视频存储在 Ant Media Server 中的另一个驱动器中?