打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Android: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath':

我按照ExoPlayer的github指引添加

implementation 'com.google.android.exoplayer:exoplayer:2.X.X'

发现根本run不起来,并报错如题

后来在stackoverflow找到了解决方案,来源为:https://stackoverflow.com/questions/46949622/android-studio-3-0-unable-to-resolve-dependency-for-appdexoptions-compileclas
出现问题的原因在于app含有buildtype但是library的依赖没有,所以我们需要添加一个matching configuration fallbacks

  buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'        }        dexOptions {            // release & debug is in project animators            matchingFallbacks = ['release', 'debug']        }        debug {        }    }

在dexOptions下增加callback即可

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Unable to resolve dependency for :app@debug/compileClasspath: Could not resolve com.android.suppor
Unable to resolve target 'android
Unable to resolve target 'android
Android之在eclipse编译项目出现unable to resolve target android-20解决办法
Android studio 3.4 新建项目报错Error:unable to resolve dependency for app@。。。解决办法
导入android项目总数出现:Unable to resolve target 'android-9'
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服