【问题标题】:style attribute 'android:attr/attr/gravity' not found,未找到样式属性“android:attr/attr/gravity”,
【发布时间】:2020-03-16 10:11:49
【问题描述】:

我对 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”。

【问题讨论】:

  • 重力名称在哪里?
  • C:\Users*MY_USER*\AppData\Local\Android\Sdk\platforms\android-28\data\res\values\attrs.xml
  • 有关此问题的任何更新?

标签: android xml android-studio


【解决方案1】:

我认为您正在使用 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 Documentation 的新用途。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-01-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-12
    • 1970-01-01
    • 2021-02-10
    相关资源
    最近更新 更多