【发布时间】:2015-11-27 06:20:54
【问题描述】:
我正在使用 Android Studio 编译sdk版本:-API 23:Android 6.0 (Marshmallow) 构建工具版本:-23.0.2
得到这个错误
错误:(2) 解析 XML 时出错:格式不正确(无效令牌)
错误:任务 ':app:processDebugResources' 执行失败。
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'E:\AndroidSdk\sdk\build-tools\23.0.2\aapt.exe'' 完成非零退出值 1
我的代码是
<?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
< TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your number to be doubled."/>
< EditText
android:id="@+id/inputNum"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</EditText>
< Button
android:id="@+id/doubleme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Double Me"/>
</LinearLayout>
【问题讨论】:
-
尝试删除第一行
<?xml version="1.0" encoding="utf-8"?>?