Android Emulator not running

I am trying to run my appium automations using the Android Emulator, and am running into an issue where the environment is not available. The exact error I am getting is as follows:

 Error: [init({"appium-version":"1.0","platformName":"Android","platformVersion":"5.1","deviceName":"Android Emulator","app":"/Users/andrew/Documents/sqor-dev-debug-4.5-19.apk","app-package":"","app-activity":""})] The environment you requested was unavailable.

My code is set up like so:

var wd = require('wd'),
chai = require('chai'),
_ = require('underscore'),
assert = require('assert'),
request = require('superagent'),
R = require('ramda');

var appPath = "/Users/andrew/Documents/sqor-dev-debug-4.5-19.apk";

var desired = {
"appium-version": "1.0",
platformName: "Android",
platformVersion: "5.1",
deviceName: "Android Emulator",
app: appPath,
"app-package": "",
"app-activity": ""

var driver = wd.promiseChainRemote("", 4723);

I know for sure that the app path is correct, and as far as I know my emulator is called Android Emulator. Any help would be most appreciated

Can you start the Emulator manually? It should be obvious what the name is if you do so.

When the emulator opens, it has a title of ‘5554:AVD_for_Nexus_5_by_Google’

Well, that’s very different from “Android Emulator”. Does your script work better with the new name?

No. And according to the Appium docs, the deviceName is actually ignored for Android, so it shouldn’t even make a difference. I’ve run the tests before with that being blank before, but it’s been a few months so I’m essentially having to re-learn everything right now. For some reason, i can’t get my emulator to communicate with the Appium GUI. Here is a screen shot of my settings. The App Path is definitely correct.

And here is a screen shot of the errors I get through the GUI

From the screenshot of the errors it looks like the name is, “emulator-5554”.

Also, the error is no longer, “Environment not available”, but is now, “Unable to install apk”. It looks like you are making progress, frustrating as it is.

Edited to add: If it were me, I would bring up the emulator manually and try installing the apk with the adb commands you see in the error log to see if I could pin down exactly what’s failing.

1 Like

I looked again and the actual error is “INSTALL_FAILED_CONFLICTING_PROVIDER”. I did a google of that:

From a quick reading it may be that you have an old version of the apk installed with a different manifest file. Removing that by hand may help things here.

1 Like

This seems to be part of the issue. I went ahead and uninstalled the app that was already loaded into the emulator (which I did’t realize was even there until just now). When I was running it on a real device, it would automatically install the newest version of the app if I had updated the latest build, not sure why it wouldn’t here. But thank you… making progress. Let’s see if I can get it to run from my command line now.