问题

我正在尝试在Eclipse中的Android应用程序上添加一个文本字段,但随后我将Plain text选项拖到图形布局上,底部会显示一条消息。它读取Exception raised during rendering: java.lang.System.arraycopy([CI[CII)V Exception details are logged in Window > Show View > Error Log即使我去了Window > Show View也没有错误日志选项。现在整个设计师都没用,因为我不能再使用它了,直到我从xml中直接删除了EditText。导致此错误的原因是什么,我该如何解决?我正在运行最新版本(截至今天,6-30-14)和Windows 8 Pro x64。

这是我的完整布局代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${relativePackage}.${activityClass}" >

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="18dp"
    android:text="@string/welcome_text" />

<EditText
    android:id="@+id/editText1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:ems="10"
    android:inputType="text">

    <requestFocus />
</EditText>

</RelativeLayout>

#1 热门回答(302 赞)

检查"在渲染布局时使用的Android版本",并确保你没有使用以"W"结尾的Android版本(例如,API 20:Android 4.4W)。我不相信Wear支持EditText

在Android Studio和Eclipse中,它是布局预览工具栏中绿色android的下拉列表。你可能希望明确设置它,而不允许IDE自动选择Android版本。


#2 热门回答(106 赞)

在Eclipse IDE中,只需更改用于预览的API版本,如下面的屏幕截图所示。而不是"自动选择最佳",而是手动选择适合你的那个(API 17为我工作)。

enter image description here


#3 热门回答(9 赞)

我为Android 4.2改变了我的Android版本,但它仍然不适合我。我尝试了不同的解决方案,发现它只能通过删除Android 4.4W包。

Window> Android SDK Manager>检查Android 4.4W(API 20)是否已安装>删除包


原文链接