Android app in Eclipse: Edit text not showing on Graphical layout
Asked Answered
H

6

105

I am trying to add a text field onto my Android app in Eclipse, but then I drag the Plain text option on to the graphical layout, a message at the bottom comes up. It reads Exception raised during rendering: java.lang.System.arraycopy([CI[CII)V Exception details are logged in Window > Show View > Error Log Even when I go to Window > Show View there is no error log option. The whole designer is useless now, because I can not use it anymore until I delete the EditText directly from the xml. What is causing this error, and how do I fix it? I am running the latest version (as of today, 6-30-14), and Windows 8 Pro x64.

Here is my full layout code:

<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>
Hefter answered 1/7, 2014 at 0:56 Comment(5)
Post your full layout. Also try "Alt+Shift+Q, L" to get the error log. You should learn to use the xml tab. It is much more flexible and easier to use than the GUI.Janettejaneva
What are you trying to accomplish? Does your layout look the way you want or you don't see anything? It seems to work for me so the only thing I could see without more info is if you don't have a string in your strings.xml with welcome_type_in_a_new_or_existing_note_name. Which, by the way, is an unnecessarily long name.Janettejaneva
I don't see anything in the design window. It just has it grayed out with the error "Exception raised during rendering: java.lang.System.arraycopy([CI[CII)V" Also, I have changed the long name to "welcome_text"Hefter
What happens when you run the app? We really need to know what error you are getting to be of any help. As I said, your xml works fine for me. Did you try the key combination I suggested to get the error log?Janettejaneva
Why so many votes for the answer and so few for the question?Countersink
I
301

Check the "Android version to use when rendering layouts" and make sure you're not using a version that ends in "W" for Android Wear (e.g. API 20: Android 4.4W). I don't believe Wear supports EditText.

In both Android Studio and Eclipse, it's the dropdown with the green android in the layout preview's toolbar. You may want to set it explicitly and not allow the IDE to choose the Android version automatically.

Ibnrushd answered 1/7, 2014 at 4:17 Comment(0)
C
106

From the Eclipse IDE, just change the API version to use for previewing, as shown in below screenshot. Instead of "Automatically Pick Best", manually select the one which works for you (API 17 worked for me).

enter image description here

Clubbable answered 7/7, 2014 at 8:51 Comment(0)
S
9

I changed my Android version for Android 4.2, but it still not work for me. I tried different solutions found that it only work by deleting Android 4.4W package.

Window > Android SDK Manager > check Android 4.4W(API 20) if it was installed > Delete package

Saccharify answered 3/7, 2014 at 2:57 Comment(1)
are you sure it will work by deleting API20 package as i am facing the same issue and i am trying to download the other API's as wellLeoraleos
P
2

If you are facing this on Android Studio, follow along

1) Uninstall Android 4.4W(API 20) from the SDK Manager

2) Make sure you have Android SDK Build Tools 19.1 installed from the SDK Manager.

3) Edit build.gradle within your app folder. Set the following two values as below

compileSdkVersion 19
buildToolsVersion "19.1"

4) The IDE will prompt you to sync the Gradle file with your project, click Yes.

5) Open your activity file and then change the 'Android version to use when rendering layouts in IDE' to 'API 19'. This is the green colored Android Bot towards the right on the preview window

Particularity answered 24/9, 2014 at 21:20 Comment(0)
O
0

I deleted 4.4w from my sdk install pile, which must have slipped past me last time I installed an sdk. Once I removed it it was no longer and option, and eclipse picked an sdk I did have that wasn't W and it worked.

Ola answered 22/9, 2014 at 15:13 Comment(0)
B
0

The W in Android 4.4W suggest wearable devices. 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

Check it out @ https://developer.android.com/design/wear/index.html

You can change your previewing API version as Jim suggested if u don't want to develop apps for wearable devices.

Bystreet answered 2/11, 2014 at 6:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.