11

I installed the Android SDK on my Ubuntu 11.10 (32-bit) machine. I also installed Eclipse (3.7) and the associated plugins for Android development, all on openjdk6. Using eclipse, I successfully created an Android Virtual Device (using AVD Manager). However when I try to run this virtual device, through Eclipse OR using the "emulator" Android SDK executable, the emulated device shows up for a couple of seconds and then crashes with the following message:

[xcb] Unknown sequence number while processing queue [xcb] Most likely
this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.

emulator-arm: ../../src/xcb_io.c:273: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.

Aborted

I tried googling the problem, but could not get a working solution. Some suggested switching from openjdk to the sun/oracle jdk. I tried this (openjdk6 -> oracle jdk7), but no change in the result. Also updated Ubuntu 11.10 using the latest patches with the same result again. My machine is an IBM Thinkpad R52 with Pentium M processor 1.73GHz, 1 GB RAM, with Ubuntu running out of an external hard drive.

Any idea?

Community
  • 1
  • 1
Pramod
  • 113
  • 1
  • 6
  • Do you have the Snapshot option for the device enabled? I had some troubles with it (but on a windows machine) and it worked better with the snapshot functionality switched off. Edit: JDK7 is currently not supported. So if you switch to oracle jdk use version 6 :) – Nicholas Nov 29 '11 at 15:13
  • ADT version? i too had some problem wit emulator, but not exactly the same.. and finally I update ADT to 15.1.. then it working nicely. – Jayabal Nov 29 '11 at 15:31
  • Thanks. Snapshot option is disabled and ADT version is 15.0.1 (I guess thats the latest yet). I shall try out the option with sun's jdk 6 and confirm. – Pramod Nov 29 '11 at 15:53
  • 3
    Got it!! I had originally installed the SDK on a NTFS drive and then moved it to a native ext2. File permissions got totally messed up. When I ran emulator with the -verbose mode, it seemed to die after a call to the ddms script. Checked permissions and saw it was not an "executable". Fixed that and everything works fine now. What a wild goose chase! – Pramod Nov 29 '11 at 17:13
  • @Pramod: Could you please answer your own question, accept it, and then close it. Thanks. – Troubadour Feb 25 '12 at 16:41

4 Answers4

3

I had a permissions problem, much like Pramod's comment to the original question indicated. In my case, ddms wasn't executable.

To fix:

cd /path/to/android/sdk/tools

Once you're in the tools folder:

chmod +x ddms

The same approach should work if you have any other non-executable files causing similar problems.

1

I also faced the same problem, and finally got this solution:

  1. Newly install Android SDK tools & Support Library from AVD manager
  2. Don't use an old SDK which is copied from previous place
  3. Download latest SDK from Android AVD manager
  4. Set Preferences

Finally, restart Eclipse & PC

sravan
  • 5,303
  • 1
  • 31
  • 33
  • You do not have to download new SDK, tools and libraries again and again, and you can use the same copy over and over again. Your settings in the preferences may be wrong. I have reinstalled my OS so many times, and I can still use the same eclipse installation. Just have to check the environment variables, and that Java is installed or not. – Abhinav Saxena Dec 05 '14 at 08:22
0

To fix this, in Linux Ubuntu >14, I did the following things:

  • Downloaded and reinstalled the latest Eclipse, 64bit in my case.
  • I had the SDK so I pointed the directory in the Eclipse-->Preferences-->Android option.
  • Used Chown recursively, to take over the ownership of these folders: SDK, .android and all the backed up folders that had my project.
  • Used chmod recursively to give the executable permission to the executsbles in SDK.
  • followed How to install ia32-libs in Ubuntu 14.04 LTS (Trusty Tahr) in case there was no fix.
  • followed How to diagnose "Error executing aapt" error in Eclipse? in case there was no fix.
  • Correct the path of NDK in the preference as well in case there was no fix.
Dr-Bracket
  • 4,299
  • 3
  • 20
  • 28
Abhinav Saxena
  • 1,990
  • 2
  • 24
  • 55
0

I may not have the solution for you problem, but I stopped using the emulator a few months ago and switched it with an x86 virtual machine inside a virtual box, it is so much faster (actually it's about 4 times faster than my HTC sensation).

you can find all the details and installation instructions here:

speeding-up-the-android-emulator

hope it helps.

Rotemmiz
  • 7,933
  • 3
  • 36
  • 36