
在下面的build.gradle中,我添加了配置部分以避免双重包含支持库.支持库用于主项目和依赖项目,如facebook sdk.如果没有配置部分,我会得到“意想不到的顶级异常”.添加该配置会使错误消失,应用程序一切正常.
现在,我正在尝试将RecyclerVIEw添加到我的应用程序中,并且在充气RecyclervIEw时找不到RecyclerVIEw类(尽管它构建正常).如果我删除了facebook SDK和配置部分,则recyclervIEw工作正常.
问题:我可以对build.gradle进行哪些更改以使facebook SDK正常工作并且RecyclerVIEw可以正常工作?换句话说,为什么配置部分不包括v7,只是它应该排除v4?
dependencIEs { compile filetree(include: ['*.jar'], dir: 'libs') compile 'com.androID.support:support-v4:+' compile 'com.androID.support:support-v13:+' compile 'com.androID.support:cardvIEw-v7:+' compile 'com.androID.support:recyclervIEw-v7:+' compile 'com.Google.androID.gms:play-services:4.4.52' compile project(':facebook-3.15') compile project(':parse-1.5.1') compile project(':vIEwpagerindicator-2.4.1')}configurations { // to avoID double inclusion of support librarIEs all*.exclude group: 'com.androID.support', module: 'support-v4'}解决方法:
如果您与v4支持库存在依赖冲突,则可以通过gradle脚本将其从其中一个库中排除:
compile ('com.androID.support:recyclervIEw-v7:+') { exclude module: 'support-v4'} 总结 以上是内存溢出为你收集整理的android中的gradle依赖错误全部内容,希望文章能够帮你解决android中的gradle依赖错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)