So today, while writing an example for the JCG community, I came across the following exception, while trying to add an
EditText
element to my application:
Exception raised during rendering: java.lang.System.arraycopy([CI[CII)V
Despite the fact that I selected Android 4.4
(API 19
) for my application, I noticed that the selected Android API
in the Graphical Layout
of my XML
code was actually wrong:
So, the easy way, I clicked the dropdown to select again my initial option:
Note: the Wear
versions don’t support EditText
elements and that’s why we got the exception.
And of course, everything was fine after that:
Cheers!
Advertisements
So Simple!! Thanks! Was frustrating me for a long time!
LikeLike
Wow, that was easy…
Was struggeling a while whith this now!
Do you know why the API20: Android L is not selectable, although it is installed in the SDK Manager?
Or is it included in the 4.4W API?
LikeLike
Ok, I forgot to include System Images in the SDK Manager.
Now the API 20: Android L is also available and it works fine.
LikeLike
Hi Christian, thank you for your comment!
As you probably know, too, Android L will be officially “launched” at late 2014, so till then, it 'll be in a pilot mode.
Nevertheless, we are actually able to develop “L” apps, under some guidelines.
To ensure that everything is set properly for “L development”, try following the official guide: http://developer.android.com/preview/setup-sdk.html
As you probably noticed, there is also a special reference for System Images, under the “Set Up Hardware and AVDs” paragraph.
LikeLike
Thank you very much, Darklessly!
Go for it now, problem solved!
LikeLike
Wow. These errors sometimes look ominous as F**K, like I'll never be able to figure it out, and my project is doomed. Yet, they end up being so simple it's STUPID…
Thanks!
LikeLike
Thanks for the information!
Though I tried out the new API with my project and it worked with the according Emulators, clearly not with ones below L…
Now I changed back my project to API 19 (project structure + graphical layout API)
It looks good in the Android Studio design preview, but when I start the emulator (for API 19) it rearranges my controls and it doesn't really fit on the screen (same problem on the phone itself)
did I f*** up my layout with temporary switching to L?
I can't see the problem when developing, because the layout looks fine in the Preview…
You must know in “File > Project Structure” the “Build Tool Version” is still set to “20.0.0” and doesn't allow any other values…
Do you know this kind of problem?
LikeLike
I have this problem and the only API option I have is 4.4W so how do I add other options? Please help. This is so frustrating!
LikeLike
Thodoris Bais yo the best. almost deleted my whole sample project coz of that error.
thanks alot
LikeLike
Hi,
@Thodoris: hope it's ok to post now and then…?
@question:
which APIs are installed in the SDK Manager and which Android Development Kit is selected under “File > Project Structure”?
Usually depending on these things you can select the API.
LikeLike
The only positive from similar stories, is that you gain more and more experience about thinking simple while debugging 🙂
LikeLike
Nice to hear that it actually helped!
LikeLike
Hi Christian,
excuse me for the late response, but I had a lot of work during this week.
I suggest keeping the same discpline for an independent project (same versions for “Target SDK” and “Compile With” – search for “Figure 1” in this link, if you misunderstood something: http://examples.javacodegeeks.com/android/core/app/fragment/android-fragment-tabs-example/ )
This should solve your problem and if not, prefer KitKat instead of L, since L is not still so “stable”.
LikeLike
Hello Anonymoys!
First of all, as a disclaimer, you should read my recent reply to Christian (July 20, 2014 at 5:11 AM). Once this is done, I guess that you only downloaded the latest versions of the required for Android Developement, tools, so what you have to do, to get over this, is to download a now-wear version of Android SDK, by clicking the “Android SDK Manager” icon in your Eclipse IDE (a selection like this http://snag.gy/elK1P.jpg, should be good, regarding Android KitKat)
LikeLike
(@Christian: of course it's ok! )
LikeLike
Thank you so much for this
LikeLike
I am using API20:4.4W and if i click on the arrow nothing gets displayed. i get only API20 version how can i add other versions. plz help me adding edit text is more important in my project.
LikeLike
thanks a lot man it works and also helped a lot ……thanks thanks a lot
LikeLike
Thanks a lot
LikeLike
Thanks
LikeLike
Thank you very much. As simple as it is, you saved a lot of time.
LikeLike
Thank you very much for taking the time to post this. Much appreciated.
LikeLike
Thank you boss… 🙂
LikeLike
This comment has been removed by the author.
LikeLike
Thanks a lot!!!
LikeLike
Thank you!!!! I was very frustrated about this issue , and so simple to solve!!!
LikeLike
really thank you save me
LikeLike
great help…!!!!
LikeLike