gpt4 book ai didi

android - 错误 : unknown tag <:string> in my app

转载 作者:行者123 更新时间:2023-11-29 14:59:33 25 4
gpt4 key购买 nike

当我尝试运行特定应用程序时,Gradle 无法编译并显示这个奇怪的错误。我在文件中搜索了标签,但不存在这样的标签。 The exact state of the app

error: unknown tag <:string>. Message{kind=ERROR, text=error: unknown tag <:string>., sources=[C:\Users\nEW u.gradle\caches\transforms-1\files-1.1\constraint-layout-1.1.0.aar\b3e4ef6bef14a8fe09fa894d105f65d7\res\values\values.xml:3:5-61], original message=, tool name=Optional.of(AAPT)}

但是,我之前构建的其他应用程序并非如此,它们运行平稳,没有任何错误。请告诉我有什么补救措施。先谢谢你。

编辑:较新的项目也面临同样的问题。

编辑 2:当我在应用程序的 build.gradle 中删除 implementation 'com.android.support.constraint:constraint-layout:1.1.0' 时。它显示此错误。

error: unknown tag <:string>. Message{kind=ERROR, text=error: unknown tag <:string>., sources=[C:\Users\nEW u.gradle\caches\transforms-1\files-1.1\support-core-ui-27.1.1.aar\375c9cd48ecaf5e9681416f258535c78\res\values\values.xml:3:5-61], original message=, tool name=Optional.of(AAPT)}

文件C:\Users\nEW u.gradle\caches\transforms-1\files-1.1\constraint-layout-1.1.0.aar\b3e4ef6bef14a8fe09fa894d105f65d7\res\values\values.xml:3:5-61

<?xml version="1.0" encoding="utf-8"?>
<resources>
<attr format="boolean" name="barrierAllowsGoneWidgets"/>
<attr format="enum" name="barrierDirection">
<enum name="left" value="0"/>
<enum name="right" value="1"/>
<enum name="top" value="2"/>
<enum name="bottom" value="3"/>
<enum name="start" value="5"/>
<enum name="end" value="6"/>
</attr>
<attr format="boolean" name="chainUseRtl"/>
<attr format="reference" name="constraintSet"/>
<attr format="string" name="constraint_referenced_ids"/>
<attr format="reference" name="content"/>
<attr name="emptyVisibility">
<enum name="gone" value="0"/>
<enum name="invisible" value="1"/>
</attr>
<attr format="boolean" name="layout_constrainedHeight"/>
<attr format="boolean" name="layout_constrainedWidth"/>
<attr format="integer" name="layout_constraintBaseline_creator"/>
<attr format="reference|enum" name="layout_constraintBaseline_toBaselineOf">
<enum name="parent" value="0"/>
</attr>
<attr format="integer" name="layout_constraintBottom_creator"/>
<attr format="reference|enum" name="layout_constraintBottom_toBottomOf">
<enum name="parent" value="0"/>
</attr>
<attr format="reference|enum" name="layout_constraintBottom_toTopOf">
<enum name="parent" value="0"/>
</attr>
<attr format="reference" name="layout_constraintCircle"/>
<attr format="integer" name="layout_constraintCircleAngle"/>
<attr format="dimension" name="layout_constraintCircleRadius"/>
<attr format="string" name="layout_constraintDimensionRatio"/>
<attr format="reference|enum" name="layout_constraintEnd_toEndOf">
<enum name="parent" value="0"/>
</attr>
<attr format="reference|enum" name="layout_constraintEnd_toStartOf">
<enum name="parent" value="0"/>
</attr>
<attr format="dimension" name="layout_constraintGuide_begin"/>
<attr format="dimension" name="layout_constraintGuide_end"/>
<attr format="float" name="layout_constraintGuide_percent"/>
<attr name="layout_constraintHeight_default">
<enum name="spread" value="0"/>
<enum name="wrap" value="1"/>
<enum name="percent" value="2"/>
</attr>
<attr format="dimension|enum" name="layout_constraintHeight_max">
<enum name="wrap" value="-2"/>
</attr>
<attr format="dimension|enum" name="layout_constraintHeight_min">
<enum name="wrap" value="-2"/>
</attr>
<attr format="float" name="layout_constraintHeight_percent"/>
<attr format="float" name="layout_constraintHorizontal_bias"/>
<attr format="enum" name="layout_constraintHorizontal_chainStyle">
<enum name="spread" value="0"/>
<enum name="spread_inside" value="1"/>
<enum name="packed" value="2"/>
</attr>
<attr format="float" name="layout_constraintHorizontal_weight"/>
<attr format="integer" name="layout_constraintLeft_creator"/>
<attr format="reference|enum" name="layout_constraintLeft_toLeftOf">
<enum name="parent" value="0"/>
</attr>
<attr format="reference|enum" name="layout_constraintLeft_toRightOf">
<enum name="parent" value="0"/>
</attr>
<attr format="integer" name="layout_constraintRight_creator"/>
<attr format="reference|enum" name="layout_constraintRight_toLeftOf">
<enum name="parent" value="0"/>
</attr>
<attr format="reference|enum" name="layout_constraintRight_toRightOf">
<enum name="parent" value="0"/>
</attr>
<attr format="reference|enum" name="layout_constraintStart_toEndOf">
<enum name="parent" value="0"/>
</attr>
<attr format="reference|enum" name="layout_constraintStart_toStartOf">
<enum name="parent" value="0"/>
</attr>
<attr format="integer" name="layout_constraintTop_creator"/>
<attr format="reference|enum" name="layout_constraintTop_toBottomOf">
<enum name="parent" value="0"/>
</attr>
<attr format="reference|enum" name="layout_constraintTop_toTopOf">
<enum name="parent" value="0"/>
</attr>
<attr format="float" name="layout_constraintVertical_bias"/>
<attr format="enum" name="layout_constraintVertical_chainStyle">
<enum name="spread" value="0"/>
<enum name="spread_inside" value="1"/>
<enum name="packed" value="2"/>
</attr>
<attr format="float" name="layout_constraintVertical_weight"/>
<attr name="layout_constraintWidth_default">
<enum name="spread" value="0"/>
<enum name="wrap" value="1"/>
<enum name="percent" value="2"/>
</attr>
<attr format="dimension|enum" name="layout_constraintWidth_max">
<enum name="wrap" value="-2"/>
</attr>
<attr format="dimension|enum" name="layout_constraintWidth_min">
<enum name="wrap" value="-2"/>
</attr>
<attr format="float" name="layout_constraintWidth_percent"/>
<attr format="dimension" name="layout_editor_absoluteX"/>
<attr format="dimension" name="layout_editor_absoluteY"/>
<attr format="dimension" name="layout_goneMarginBottom"/>
<attr format="dimension" name="layout_goneMarginEnd"/>
<attr format="dimension" name="layout_goneMarginLeft"/>
<attr format="dimension" name="layout_goneMarginRight"/>
<attr format="dimension" name="layout_goneMarginStart"/>
<attr format="dimension" name="layout_goneMarginTop"/>
<attr name="layout_optimizationLevel">
<flag name="none" value="0"/>
<flag name="standard" value="3"/> <!-- for now only direct & barriers -->
<flag name="direct" value="1"/>
<flag name="barrier" value="2"/>
<flag name="chains" value="4"/>
<flag name="dimensions" value="8"/>
</attr>
<declare-styleable name="ConstraintLayout_Layout"><attr name="android:orientation"/><attr name="android:minWidth"/><attr name="android:minHeight"/><attr name="android:maxWidth"/><attr name="android:maxHeight"/><attr name="layout_optimizationLevel"/><attr name="constraintSet"/><attr name="barrierDirection"/><attr name="barrierAllowsGoneWidgets"/><attr name="constraint_referenced_ids"/><attr name="chainUseRtl"/><attr name="layout_constraintCircle"/><attr name="layout_constraintCircleRadius"/><attr name="layout_constraintCircleAngle"/><attr name="layout_constraintGuide_begin"/><attr name="layout_constraintGuide_end"/><attr name="layout_constraintGuide_percent"/><attr name="layout_constraintLeft_toLeftOf"/><attr name="layout_constraintLeft_toRightOf"/><attr name="layout_constraintRight_toLeftOf"/><attr name="layout_constraintRight_toRightOf"/><attr name="layout_constraintTop_toTopOf"/><attr name="layout_constraintTop_toBottomOf"/><attr name="layout_constraintBottom_toTopOf"/><attr name="layout_constraintBottom_toBottomOf"/><attr name="layout_constraintBaseline_toBaselineOf"/><attr name="layout_constraintStart_toEndOf"/><attr name="layout_constraintStart_toStartOf"/><attr name="layout_constraintEnd_toStartOf"/><attr name="layout_constraintEnd_toEndOf"/><attr name="layout_goneMarginLeft"/><attr name="layout_goneMarginTop"/><attr name="layout_goneMarginRight"/><attr name="layout_goneMarginBottom"/><attr name="layout_goneMarginStart"/><attr name="layout_goneMarginEnd"/><attr name="layout_constrainedWidth"/><attr name="layout_constrainedHeight"/><attr name="layout_constraintHorizontal_bias"/><attr name="layout_constraintVertical_bias"/><attr name="layout_constraintWidth_default"/><attr name="layout_constraintHeight_default"/><attr name="layout_constraintWidth_min"/><attr name="layout_constraintWidth_max"/><attr name="layout_constraintWidth_percent"/><attr name="layout_constraintHeight_min"/><attr name="layout_constraintHeight_max"/><attr name="layout_constraintHeight_percent"/><attr name="layout_constraintLeft_creator"/><attr name="layout_constraintTop_creator"/><attr name="layout_constraintRight_creator"/><attr name="layout_constraintBottom_creator"/><attr name="layout_constraintBaseline_creator"/><attr name="layout_constraintDimensionRatio"/><attr name="layout_constraintHorizontal_weight"/><attr name="layout_constraintVertical_weight"/><attr name="layout_constraintHorizontal_chainStyle"/><attr name="layout_constraintVertical_chainStyle"/><attr name="layout_editor_absoluteX"/><attr name="layout_editor_absoluteY"/></declare-styleable>
<declare-styleable name="ConstraintLayout_placeholder"><attr name="emptyVisibility"/><attr name="content"/></declare-styleable>
<declare-styleable name="ConstraintSet"><attr name="android:orientation"/><attr name="android:id"/><attr name="android:visibility"/><attr name="android:alpha"/><attr name="android:elevation"/><attr name="android:rotation"/><attr name="android:rotationX"/><attr name="android:rotationY"/><attr name="android:scaleX"/><attr name="android:scaleY"/><attr name="android:transformPivotX"/><attr name="android:transformPivotY"/><attr name="android:translationX"/><attr name="android:translationY"/><attr name="android:translationZ"/><attr name="android:layout_width"/><attr name="android:layout_height"/><attr name="android:layout_marginStart"/><attr name="android:layout_marginBottom"/><attr name="android:layout_marginTop"/><attr name="android:layout_marginEnd"/><attr name="android:layout_marginLeft"/><attr name="android:layout_marginRight"/><attr name="layout_constraintCircle"/><attr name="layout_constraintCircleRadius"/><attr name="layout_constraintCircleAngle"/><attr name="layout_constraintGuide_begin"/><attr name="layout_constraintGuide_end"/><attr name="layout_constraintGuide_percent"/><attr name="layout_constraintLeft_toLeftOf"/><attr name="layout_constraintLeft_toRightOf"/><attr name="layout_constraintRight_toLeftOf"/><attr name="layout_constraintRight_toRightOf"/><attr name="layout_constraintTop_toTopOf"/><attr name="layout_constraintTop_toBottomOf"/><attr name="layout_constraintBottom_toTopOf"/><attr name="layout_constraintBottom_toBottomOf"/><attr name="layout_constraintBaseline_toBaselineOf"/><attr name="layout_constraintStart_toEndOf"/><attr name="layout_constraintStart_toStartOf"/><attr name="layout_constraintEnd_toStartOf"/><attr name="layout_constraintEnd_toEndOf"/><attr name="layout_goneMarginLeft"/><attr name="layout_goneMarginTop"/><attr name="layout_goneMarginRight"/><attr name="layout_goneMarginBottom"/><attr name="layout_goneMarginStart"/><attr name="layout_goneMarginEnd"/><attr name="layout_constrainedWidth"/><attr name="layout_constrainedHeight"/><attr name="layout_constraintHorizontal_bias"/><attr name="layout_constraintVertical_bias"/><attr name="layout_constraintWidth_default"/><attr name="layout_constraintHeight_default"/><attr name="layout_constraintWidth_min"/><attr name="layout_constraintWidth_max"/><attr name="layout_constraintWidth_percent"/><attr name="layout_constraintHeight_min"/><attr name="layout_constraintHeight_max"/><attr name="layout_constraintHeight_percent"/><attr name="layout_constraintLeft_creator"/><attr name="layout_constraintTop_creator"/><attr name="layout_constraintRight_creator"/><attr name="layout_constraintBottom_creator"/><attr name="layout_constraintBaseline_creator"/><attr name="layout_constraintDimensionRatio"/><attr name="layout_constraintHorizontal_weight"/><attr name="layout_constraintVertical_weight"/><attr name="layout_constraintHorizontal_chainStyle"/><attr name="layout_constraintVertical_chainStyle"/><attr name="layout_editor_absoluteX"/><attr name="layout_editor_absoluteY"/></declare-styleable>
<declare-styleable name="LinearConstraintLayout"><attr name="android:orientation"/></declare-styleable>
</resources>

C:\Users\nEW u.gradle\caches\transforms-1\files-1.1\support-core-ui-27.1.1.aar\375c9cd48ecaf5e9681416f258535c78\res\values\values.xml:3: 5-61

<?xml version="1.0" encoding="utf-8"?>

        <flag name="bottom" value="0x50"/>

<flag name="left" value="0x03"/>

<flag name="right" value="0x05"/>

<flag name="center_vertical" value="0x10"/>

<flag name="fill_vertical" value="0x70"/>

<flag name="center_horizontal" value="0x01"/>

<flag name="fill_horizontal" value="0x07"/>

<flag name="center" value="0x11"/>

<flag name="fill" value="0x77"/>

<flag name="clip_vertical" value="0x80"/>

<flag name="clip_horizontal" value="0x08"/>

<flag name="start" value="0x00800003"/>

<flag name="end" value="0x00800005"/>
</attr><attr format="enum" name="layout_insetEdge">

<enum name="none" value="0x0"/>

<enum name="top" value="0x30"/>

<enum name="bottom" value="0x50"/>

<enum name="left" value="0x03"/>

<enum name="right" value="0x05"/>

<enum name="start" value="0x00800003"/>

<enum name="end" value="0x00800005"/>
</attr><attr name="layout_dodgeInsetEdges">

<flag name="none" value="0x0"/>

<flag name="top" value="0x30"/>

<flag name="bottom" value="0x50"/>

<flag name="left" value="0x03"/>

<flag name="right" value="0x05"/>

<flag name="start" value="0x00800003"/>

<flag name="end" value="0x00800005"/>

<flag name="all" value="0x77"/>
</attr></declare-styleable>
<style name="Widget.Support.CoordinatorLayout" parent="android:Widget">
<item name="statusBarBackground">#000000</item>
</style>

最佳答案

有非常相似的错误。原来原因与字符串数组有关。在你的string.xml检查你是否有空 <string-array>或类似的东西

<string-array name="array_name">
<string name="array_name_item">Some text</string>
...
</string-array>

你应该更新 <string>标记为 <item>像这样的标签:

<string-array name="array_name">
<item name="array_name_item">Some text</item>
...
</string-array>

希望它能解决您的问题,因为这里的 Android Studio 错误消息真的很困惑。

关于android - 错误 : unknown tag <:string> in my app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50772389/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com