Cordova android emulation - Error: Cannot read property 'semver' of null

前端 未结 6 824
醉梦人生
醉梦人生 2021-01-30 13:30

Trying to emulate Android app with cordova, but get this error message:

Built the following apk(s): /Users/jnj/cordova/hello/platforms/android/build/outputs/apk/andr

6条回答
  •  北恋
    北恋 (楼主)
    2021-01-30 13:44

    For me, on a Mac, the following was required to get the sdk running in the emulator:

    Open Android Studio (and open your project if it doesn't open at start up)

    Select 'Tools -> AVD Manager' to open the device manager tool

    Right click on the relevant image (or create one if required first)

    Select 'Cold Boot Now' and wait for the emulator to boot up

    In a terminal cd to the folder where your platforms and config.xml. Where cordova commands can be run

    List available devices with adb devices (Install it if it says not available) to get a list of running devices, and grab your EMULATOR ID. For me on this occasion it was emulator-5554.

    Run the command cordova run android --target "emulator-5554" replacing emulator-5554 with your own reference.

提交回复
热议问题