设为首页 加入收藏

TOP

Android: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath':
2019-09-23 11:12:14 】 浏览:57
Tags:Android: Unable 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即可

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇我也开源... React Native Messag.. 下一篇source for "Android 28 pla..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目