当前位置:网站首页>《第一行代码(第二版)》学习中百分比布局依赖导入问题
《第一行代码(第二版)》学习中百分比布局依赖导入问题
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.运行
边栏推荐
猜你喜欢
随机推荐
Redis之事务、锁
【带信息的Excel模板下载】
[MEF] Chapter 04 MEF's Multi-Component Import (ImportMany) and Directory Services
【转发与重定向(二)】
【浏览器打开导出的excel】
ES6新特性未命名参数
[Oracle's NVL function usage]
Redis之持久化机制
小程序-按钮透明无边框
go实现快速排序
去噪论文 Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising
GeoServer入门学习:07-发布多层级TIF地图大图数据
第06篇 MEF部件的生命周期(PartCreationPolicy)
GeoServer入门学习:05-多层级MBTiles规范数据发布
MATLAB:方程组的求解
oracle数据库的数据备份导出与数据导入恢复
MySQL无法启用/etc/my.cnf配置文件,重启报错Warning: World-writable config file ‘/etc/my.cnf’ is ignored的解决方法
如何改变数组对象里面的key 键名字
fastapi-实战-综述
【读代码重构有感】