用于Android本机应用程序开发的“ Foursquare”依赖项注入后的资源冲突

问题描述 投票:0回答:1

大家好:我正在使用下一个方案进行Android本机应用程序开发:

Android Studio 3.6.2

Gradle插件3.6.2

Gradle版本5.6.4

Kotlin版本1.3.61

我在build.graddle中编写下一个依赖项注入。

实现'com.foursquare:foursquare-android-oauth:1.1.0'

[当我构建项目时,并且只有在此注入之后(在打包阶段),才出现此错误:

条目名称'res / drawable / notification_bg_low.xml'发生冲突

正如我在个人搜索中发现的那样,在项目“ build.properties”文件中,我添加了下一个条目来修复错误:

android {
    packagingOptions {
        exclude 'res/drawable/notification_bg_low.xml'
    }
}

冲突已解决,但又出现了碰撞。接下来是碰撞(在每个构建过程中都发现一个碰撞):

条目名称'AndroidManifest.xml'发生冲突

条目名称'res / drawable / notification_bg.xml'发生冲突

条目名称'res / drawable / notification_bg_low.xml'发生冲突

条目名称'res / layout / notification_template_part_time.xml'发生冲突

条目名称'res / layout / notification_template_part_chronometer.xml'发生冲突

条目名称'resources.arsc'相冲突

到目前为止,我找到解决此问题的唯一方法是将所有这些文件添加到我的Project build.graddle文件中:

android {
    packagingOptions {
        exclude 'AndroidManifest.xml'
        exclude 'res/drawable/notification_bg.xml'
        exclude 'res/drawable/notification_bg_low.xml'
        exclude 'res/layout/notification_template_part_time.xml'
        exclude 'res/layout/notification_template_part_chronometer.xml'
        exclude 'resources.arsc'
    }
}

我不知道这是否是正确的解决方案。

您能帮我吗?

谢谢你。

android code-injection foursquare
1个回答
0
投票
implementation ('com.foursquare:foursquare-android-oauth:1.0.3'){ exclude group: 'com.google.android'
Adiciona esto tu tu.gradle(app)
© www.soinside.com 2019 - 2024. All rights reserved.