android - 未找到样式属性“android:attr/attr/gravity”,
问题描述
我对 android studio 系统进行了更新,但无法为我的项目构建错误指示系统文件“values.xml”。
我已经看到了很多答案,但所有答案都包括文件更改操作,我无法更改它,因为它每次都会从某个地方填满。有什么帮助吗?
下面是我的values.xml系统文件:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr format="reference" name="SquareTextView"/>
<declare-styleable name="SquareTextView"><attr format="dimension" name="minTextSize"/></declare-styleable>
<dimen name="album_thum_size">70dp</dimen>
<string name="album">Album</string>
<string name="camera">camera</string>
<string name="done">done</string>
<string name="msg_full_image">You can\'t no longer choose.</string>
<string name="msg_no_image">There is no image.</string>
<string name="msg_no_slected">There is no selected image.</string>
<string name="msg_permisssion">permission deny</string>
<string name="str_all_view">All view</string>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
<style name="SquareTextView">
<!-- some graphical improvements just for the demo. feel free to remove -->
<!--<item name="@android:attr/padding">5dp</item>-->
<item name="@android:attr/gravity">center</item>
<!-- use the next line to alter the minimum text size (uncomment first)-->
<item name="@attr/minTextSize">5dp</item>
</style>
</resources>
这是我的错误:
C:\Users*MY_USER*.gradle\caches\transforms-2\files-2.1\eded8b13b43fea070a7476e315407686\FishBun-0.4.4\res\values\values.xml:16:5-23:13:AAPT:错误:样式属性'android:attr/attr/gravity' 未找到。
解决方案
我认为您正在使用FishBun库
如果是这样,您需要在更新 Android Studio 后升级它
在您的应用程序 build.gradle 文件中更新 FishBun 库实现,如下所示
// Under the Android Plugin 3.0.0.
compile 'com.sangcomz:FishBun:1.0.0-alpha02'
compile 'com.squareup.picasso:picasso:2.71828'
compile 'io.coil-kt:coil:0.11.0'
or
compile 'com.github.bumptech.glide:glide:4.9.0'
// Android plugin 3.0.0 or higher.
implementation 'com.sangcomz:FishBun:1.0.0-alpha03'
implementation 'io.coil-kt:coil:0.11.0'
or
implementation 'com.github.bumptech.glide:glide:4.11.0'
并查看 FishBun文档以了解新用途。
推荐阅读
- c++ - C ++ - 保存值的问题 - 保存后值发生变化
- c++ - 什么没有继承到 C++ 派生类?显然, operator= 和一些构造函数实际上是继承的
- mysql - 如何在字符串值的日期比较中使用 unix_timestamp() 函数
- c++ - 写入现有的 json 文件
- r - 使用来自大量计数和年份数据集的摘要填充新数据框
- resttemplate - 用 webClient 替换 restTemplate
- c - 错误:表达式必须是可修改的 l 值
- python - 如何计算一个值重复最少次数的次数
- javascript - Javascript - 未选中 Radio 输入时更改元素内容
- javascript - 使用 JavaScript 向数组添加输入(最小值)