【发布时间】:2017-12-19 14:52:14
【问题描述】:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.molitveniseznamkackrko.MainActivity">
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp" />
</RelativeLayout>
这里是代码。错误指向第一行。如果我使用 utf-16,则应用程序在模拟器中运行,但我无法构建 apk 文件(错误:(1)错误:utf-16:不使用 UTF-8 作为文件编码。这可能会导致细微的错误非 ASCII 字符 [EnforceUTF8])。我做错了什么?
【问题讨论】:
-
确保顶部没有空行/空格
-
没有。如果它可能有帮助,当我想要自定义 TTF 字体时,这个错误开始出现。然后我决定不使用自定义字体。
标签: android xml encoding utf-8