Error : Program type already present: android.support.design.widget.CoordinatorLayout$Behavior

本文介绍了解决Android项目中出现的“program type already present”错误的方法。通过降级或升级支持库版本,如appcompat-v7和design依赖,可以有效避免此类冲突。具体操作为将appcompat-v7版本从27.1.0降至27.0.2,并添加design依赖。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解决办法:
https://stackoverflow.com/questions/49112190/error-program-type-already-present-android-support-design-widget-coordinatorl
版本降级(或者升级)

原回答

It worked when I downgrade the support appcompat gradle dependency,like follwing:

implementation'com.android.support:appcompat-v7:27.0.2'

previously it was

implementation'com.android.support:appcompat-v7:27.1.0'

OR
Also this can be fixed by just adding support design dependency to your app level build.gradle as following:

implementation'com.android.support:design:27.1.0'

原回答译文

当我降级支持appcompatgradle依赖时,它起作用,如下所示:

implementation 'com.android.support:appcompat-v7:27.0.2'

以前是

implementation 'com.android.support:appcompat-v7:27.1.0'

要么
此外,只需将支持设计依赖项添加 到您的应用程序级别即可解决此问题build.gradle:

implementation 'com.android.support:design:27.1.0'

我的build.gradle dependencies 更改后展示

implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值