Have just installed the latest version of Apache Cordova (7.0.1) on Windows, the Android SDK, added the android platform, and when trying to run the android emulator it compiles everything ok but then shows a:
Cannot read property 'replace' of undefined
Without indication or anything else to trace the error.
In the Ionic framework forum found the following answer that solved the problem:
Tracked it down to file /platforms/android/cordova/lib/emulator.js line 202:
var num = target.split('(API level ')1.replace(')', '');
Replace it with a regex search and extraction:
var num = target.match(/\d+/)[0];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With