"Lost connection with emulator while launching. Try again."


#1

Hi there - first time posting here, so here goes.

I’ve always used Processing 3 in Java mode, and I wanted to test out the Android mode. So, to make sure I really wouldn’t do anything wrong when installing everything required as to be able to use Android mode with an emulator, I had the Processing IDE configure everything as automatically as possible: I installed the mode through the IDE, when prompted for the Android SDK I let Processing install it automatically, and for the emulator, I let Processing do its thing with the default phone image and Intel HAXM and all the jazz.

Now, when I try to run a simple program like:

void setup() {
  fullScreen();
  noStroke();
  fill(0);
}

void draw() {
  background(204);
  if (mousePressed) {
    if (mouseX < width/2) {
      rect(0, 0, width/2, height); // Left
    } else {
      rect(width/2, 0, width/2, height); // Right
    }
  }
}

and I try to run the emulator using Sketch -> Run in Emulator, the IDE takes more than a minute displaying lines starting with :app:, eventually notifies me by saying “Lost connection with emulator while launching. Try again.”, with in the console the paragraph:

BUILD SUCCESSFUL in 1m 2s
28 actionable tasks: 28 executed
Emulator process exited with status 1.
EmulatorController: Emulator never booted. NOT_RUNNING
Error while starting the emulator. (NOT_RUNNING)
Shutting down any existing adb server... Done.

So … I have no idea how to solve this, since I let Processing do all the work itself. Any ideas?


#2

@Mew ===
BEGIN connecting a real phone: if you can run some simple code try with the emulator.


#3

I don’t have an Android phone at hand, as is the case for many developers. My question concerns the emulator, not connecting Android phones.

Thereby, I would say the provided code snippet is simple enough.


#4

@Mew ===

  • my answer means that the first thing to know is about your install ( i have seen a lot of cases where P5 was not able to create a correct one)
  • my answer means BEGIN to be sure about your install && as your emulator does not work try with a real phone
  • i am an android developer and, sorry, i have 10 phones at hand…though working with AS simplify a lot of problems.
  • now let it be!

#5

Look, that’s not an answer to my question. These forums are also made as future reference; right now, if anyone runs into the same problem I’m running into, they will stumble upon this thread and be disappointed to see that there is no solution given to their problem, yet they’ll have to read through needless responses (it is very irrelevant that you have 10 phones, for example; if I don’t have a single one, then that’s the situation at hand).

If you don’t have an actual solution to the problem, then don’t reply. If you do, I’m sure the community would appreciate you sharing it.