Skip to content

When including Oreo AVDs parseEmulatorsAvds crashes #10

Open

Description

@bsmithb2

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.

Activity

  1. setrar commented on Dec 4, 2020

    @setrar

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions