Skip to content

When including Oreo AVDs parseEmulatorsAvds crashes #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bsmithb2 opened this issue Feb 9, 2019 · 1 comment
Open

When including Oreo AVDs parseEmulatorsAvds crashes #10

bsmithb2 opened this issue Feb 9, 2019 · 1 comment

Comments

@bsmithb2
Copy link

bsmithb2 commented Feb 9, 2019

Hi,

When using the nativescript demo application, when I attempt to run tests using nativescript-dev-appium, the application crashes using parseEmulatorsAvds() in the AndroidController class.

Steps to repro:

  1. Get hold of the Android Accelerated Oreo avd. You do this by installing Visual Studio for Mac Community Edition, and installing their default device.
  2. Open the test repo https://github.com/bsmithb2/nativescript-mobile-bug
  3. Run the repo in VS Code (or run.ts in anywhere really.
  4. parsePlatforms on my Mac has android-27 and android-28 installed
  5. parseEmulatorsAvds() crashes "cannot read property 'sdk' of undefined"

Cause: target=Google Inc.:Google Play:27 is not parsable compared to what it's expecting.
Expected: ignore the avd, or parse differently.

@setrar
Copy link

setrar commented Dec 4, 2020

https://github.com/NativeScript/mobile-devices-controller/blob/master/lib/android-controller.ts#L727

    private static parseEmulatorsAvds() {
        const platforms = AndroidController.parsePlatforms();
        const avdsHomeDir = process.env["ANDROID_AVD_HOME"] || process.env["HOME"] || process.env["HOMEPATH"] || process.env["USERPROFILE:"];
        const emulators = new Array();

After setting ANDROID_AVD_HOME environment variable, which doesn't seem to be set by default, to whatever, I was able to  get rid of the sdk undefined issue

$ export ANDROID_AVD_HOME="???"
$ npm run e2e -- --runType android28 --verbose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants