当前位置: 移动技术网 > IT编程>移动开发>Android > Android: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath':

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

2019年09月21日  | 移动技术网IT编程  | 我要评论

滇池沉剑录,高中教学视频,娱乐城代理

我按照exoplayer的github指引添加

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

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

后来在stackoverflow找到了解决方案,来源为:
出现问题的原因在于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即可

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网