Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
224 views
in Technique[技术] by (71.8m points)

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

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/android-debug.apk ANDROID_HOME=/Users/jnj/Library/Android/sdk JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home

Error: Cannot read property 'semver' of null

Any solutions?

question from:https://stackoverflow.com/questions/47018914/cordova-android-emulation-error-cannot-read-property-semver-of-null

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is due using an emulator with an unstable Developer Preview API version.

You probably have a device using API 27 (Android 8.1).

Open your AVD, remove that device and re-run.

It's also useful to use --target <emulator_name> when launching the emulator if you have more than one.

To get a list of available names to use, call the emulate command with --list


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...