Unable to install APK on the emulator

My customer installed Android Studio and went through all the steps.

But the emulator didn’t work.

We setup a new emulator today to fix this.

Still we see this error in Xojo:

Unable to install APK on the emulator/device. Emlator/Device timeout. Unable to install.

No details.

A brand new Andorra project. The emulator shows in the inspector list for Android settings.

What can we do?

adb.exe is there in the AppData folder and should get found automatically.

Also we went to Emulator settings and turned on adb detection to specify the location of the app, but that didn’t help.

xojo must be doing something their special way to communicate with the emulator instead of following Android standards. Other tools can work with other emulators, not only the one in android studio.

It’s not nice to have no indication what is happening.

Xojo builds, emulator launches, but than nothing happens until eventually the message shows ups.

Maybe @Paul_Lefebvre knows if there is some log file to look for?

1 Like

Looking at the code, that error indicates that the Emulator took too long to startup or that Xojo has not recognized it started.

This is very early in the Android launch process. Essentially it is step 1a:

  1. Launch selected Emulator
    1a. Wait for it to finish launching by polling it using adb.

Do you get different results if you start the Emulator manually before running the Xojo app?

Well, the emulator was running part time while we tried, so that didn’t make a difference.

I wonder if Xojo could be more verbose about this.
e.g. show a message “Waiting for emulator…” and if it doesn’t respond tell us something like.
Failed to connect to emulator on localhost:9000 and then maybe we could check if there is e.g. a firewall blocking it.

1 Like

The Messages Panel already reports if the Emulator isn’t ready/available.

Still, Xojo isn’t verbose enough in many failures with Android debugging; I’m experiencing this myself a lot.

but details please.

“couldn’t find adb.exe”
“couldn’t launch adb.exe”
“adb.exe didn’t get launched.”
“can’t reach debugging port 5678 on localhost. Please check firewall.”

It’s bad for a customer to be stuck at this point.


The first and only time I tested Android, didnt work out of the box. In android studio try the tools menu, SDK manager, SDK tools and make sure the tools are instaled and updated:

1 Like

Thank you a lot, Ivan! I tried your tip and my long-term issue with Xojo not debugging my Android projects is gone! (where Xojo just hung for a minute and then nothing). Xojo miraculously went further, up to a working emulation.
I had given up and built a real app for every small change; that was painful.