Android 渲染过程中引发异常:java.lang.System.arraycopy
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24451490/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Exception raised during rendering: java.lang.System.arraycopy
提问by Shayan Pourvatan
I have a Strange problem with the new ADT version. I have downloaded the new Eclipse from eclipse.orgthen I install ADT on it. Everything works fine; I can create a project for android and all thing work well, except:
我对新的 ADT 版本有一个奇怪的问题。我已经从eclipse.org下载了新的 Eclipse,然后在上面安装了 ADT。一切正常;我可以为 android 创建一个项目并且一切正常,除了:
When trying to create one xml layout, I get the following error:
尝试创建一个 xml 布局时,出现以下错误:
Exception raised during rendering: java.lang.System.arraycopy
and in the Error Log I see:
在错误日志中我看到:
Failed to render set of icons for AnalogClock, AutonCompleteTextView, button, SmallButton , ....
Ff I change EditText
to TextView
, the error disappears. I can run my program even with this warning, but I want to see my layout in graphical section.
如果我更改EditText
为TextView
,错误就会消失。即使出现此警告,我也可以运行我的程序,但我想在图形部分查看我的布局。
My layout is:
我的布局是:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/settingback"
android:orientation="vertical"
android:weightSum="480" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="50"
android:gravity="right"
android:orientation="horizontal" >
<Button
android:id="@+id/close"
android:layout_width="50dp"
android:layout_height="match_parent"
android:background="#00000000" />
</LinearLayout>
<View
android:id="@+id/view1"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="20" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="40"
android:orientation="horizontal"
android:weightSum="320" >
<View
android:id="@+id/view8"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40" />
<EditText
android:id="@+id/textView1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="240"
android:gravity="center|right"
android:background="#00000000"/>
<View
android:id="@+id/view9"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40" />
</LinearLayout>
<View
android:id="@+id/view2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="20" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="35"
android:orientation="horizontal" >
<View
android:id="@+id/view10"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40" />
<EditText
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="240"
android:gravity="center|right"
android:background="#00000000" />
<View
android:id="@+id/view11"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40" />
</LinearLayout>
<View
android:id="@+id/view3"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="10" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="35"
android:orientation="horizontal" >
<View
android:id="@+id/view12"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40" />
<EditText
android:id="@+id/textView3"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="240"
android:gravity="center|right"
android:background="#00000000"/>
<View
android:id="@+id/view13"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40" />
</LinearLayout>
<View
android:id="@+id/view4"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="105" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="40"
android:orientation="horizontal" >
<View
android:id="@+id/view14"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40" />
<EditText
android:id="@+id/textView4"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="240"
android:gravity="center|right"
android:background="#00000000" />
<View
android:id="@+id/view15"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40" />
</LinearLayout>
<View
android:id="@+id/view5"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="40" >
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40"
/>
<EditText
android:id="@+id/textView6"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="240"
android:gravity="center|right"
android:background="#00000000" />
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="40" />
</LinearLayout>
<View
android:id="@+id/view6"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="20" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="30"
android:orientation="horizontal"
android:weightSum="320" >
<View
android:id="@+id/view16"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="90" />
<CheckBox
android:id="@+id/shake"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="70"
android:gravity="center" />
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="10" />
<CheckBox
android:id="@+id/ring"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="70"
android:gravity="center" />
<View
android:id="@+id/view17"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="80" />
</LinearLayout>
<View
android:id="@+id/view7"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="30" />
</LinearLayout>
I searched for an answer here but didn't find any. How can I fix this?
我在这里搜索了答案,但没有找到。我怎样才能解决这个问题?
PS: This problem happened on ADT 23 - I tried it with ADT 22.6, and it worked well.
PS:这个问题发生在 ADT 23 上 - 我用 ADT 22.6 试过,效果很好。
回答by Shayan Pourvatan
this problem happened on API 20 ( Android 4.4 W ) I recently have a problem with that but Problem will be solved by changing Android version to use for rendering level form API 20 ( Android 4.4 W ) to API 19 (Android 4.4.2) ( android icon in top right corner of graphical layout ) or update your SDK to Android L ( API 20 L preview )
这个问题发生在 API 20 ( Android 4.4 W ) 我最近有一个问题,但问题将通过将 Android 版本更改为用于渲染级别表单 API 20 ( Android 4.4 W ) 到 API 19 (Android 4.4.2) (图形布局右上角的 android 图标)或将您的 SDK 更新为 Android L(API 20 L 预览版)
Screen Shot :
截屏 :
回答by Bill Gates
Android Wear is a wrist watch and you cannot type anything in it so you cannot use EditText on 4.4W. Change the API to 19 or less or change it to 4.4L which can be downloaded from SDK Manager. This is not a bug.
Android Wear 是一款手表,您无法在其中输入任何内容,因此您无法在 4.4W 上使用 EditText。把API改成19以下或者改成4.4L,可以从SDK Manager下载。这不是一个错误。
回答by Supuhstar
I was having this same problem with 20 (4.4W), but it disappeared when I installed and chose 20 (4.4 L (preview)). This is probably because 4.4W is the Android Wear SDK, and so may not support all the features of standard phone/tablet Android
我在使用 20 (4.4W) 时遇到了同样的问题,但是当我安装并选择 20 (4.4 L (preview)) 时它消失了。这可能是因为 4.4W 是 Android Wear SDK,所以可能不支持标准手机/平板 Android 的所有功能
回答by user1767754
@shayan pourvatan already answered this question properly for me, i am just adding those two images describing how to install the API 20 L Version to use it then as the Preview renderer.
@shayan Pourvatan 已经为我正确回答了这个问题,我只是添加了描述如何安装 API 20 L 版本以将其用作预览渲染器的那两个图像。
回答by 6kgstront
You could update your 4.4W SDK to 4.4W2 SDK. That fixed mine.
您可以将 4.4W SDK 更新为 4.4W2 SDK。那个固定的我的。