创建新项目时,出现此错误:
Android resource compilation failed
Output: D:\Program Files\ASProject\fdym1.0\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:0: error: xml parser error: not well-formed (invalid token).
Command: D:\MyDrivers\cache\caches\transforms-1\files-1.1\aapt2-3.2.0-alpha11-4662957-windows.jar\cfcfd1d2d0a23b2dd140f10b1a01e792\aapt2-3.2.0-alpha11-4662957-windows\aapt2.exe compile --legacy \
-o \
D:\Program Files\ASProject\fdym1.0\app\build\intermediates\res\merged\debug \
D:\Program Files\ASProject\fdym1.0\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml Daemon: AAPT2 aapt2-3.2.0-alpha11-4662957-windows Daemon #0
我的valus.xml
<?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="7"/> <!-- direct, barriers, chains -->
<flag name="direct" value="1"/>
<flag name="barrier" value="2"/>
<flag name="chains" value="4"/>
<flag name="dimensions" value="8"/>
<flag name="groups" value="32"/>
</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"/><attr name="barrierDirection"/><attr name="constraint_referenced_ids"/><attr name="android:maxHeight"/><attr name="android:maxWidth"/><attr name="android:minHeight"/><attr name="android:minWidth"/><attr name="barrierAllowsGoneWidgets"/><attr name="chainUseRtl"/></declare-styleable>
<declare-styleable name="LinearConstraintLayout"><attr name="android:orientation"/></declare-styleable>
</resources>
我的gradle工具版本:
classpath 'com.android.tools.build:gradle:3.2.0-alpha11'
我的礼物:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
我的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
我尝试删除build .gralde .idea,但不起作用
我的Android Studio版本是3.1.4
我运行旧项目没有问题,只是创建新项目。
这是我在Stack Overflow中的第一个问题,格式可能不正确 谢谢您的帮助。