当前位置:网站首页>《第一行代码(第二版)》学习中百分比布局依赖导入问题
《第一行代码(第二版)》学习中百分比布局依赖导入问题
2022-08-08 21:13:00 【kkkkkkkkira】
《第一行代码(第二版)》百分比布局依赖导入问题
无法导入‘com.android.support.percent‘(百分比布局依赖库)的解决方法
在按照《第一行代码:android(第二版)》学习百分比布局时,出现了无法导入百分比布局依赖库的问题,原因有以下几点:
1.AS已经不推荐使用compile导入依赖库
2.由于引入的第三方依赖库依赖了androidx ,而自己本身的库又是依赖的support ,导致两者不能共存。
1.添加包依赖
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
}
2.点击sync now
3.忽略出现设置长宽的错误
4.运行

边栏推荐
猜你喜欢
随机推荐
[MEF]第04篇 MEF的多部件导入(ImportMany)和目录服务
复合索引使用
第七章 类与对象
GeoServer入门学习:07-发布多层级TIF地图大图数据
中国石油大学(北京)-《 油田化学》第三阶段在线作业
Under the Windows socket (TCP) console program
超外差半导体收音机:各个元器件的作用,如何进行调试,以及工作原理
2 Scrapy
[The browser opens the exported excel]
【带信息的Excel模板下载】
js写一个气泡屏保能碰撞
ESLint: The Function constructor is eval. (no-new-func)错误解决
GeoServer入门学习:04-发布Shapfile地图数据
day7——CORS跨域问题
WebView的使用
【Excel template download with information】
Property or method “XXX“ is not defined on the instance but referenced during render.
神经网络论文Enhancing deep neural networks via multiple kernel learning
第十一章 集合
一、Canvas应用的背景(个人理解)及基础语法








