Error: Cannot read property 'replace' of undefined [Android]

Worked for me. thanks!

Worked for me . thanks a lot.

I’ll throw this out there too b/c I just had the issue. If you have more than one device defined in AVD Manager you may have to add the --target to your ionic cordova emulate android command. You can verify this using AVD manager or use ionic cordova emulate --list.

1 Like

I managed to fix this error by removing a device with api version 26 and adding one with version 25. No idea why but at least I don’t have to apply the fix to emulator.js every time I clean the project.


This works for me. Thanks.

It worked for me. Thank you very much!!!

Works for me, thank you :+1:

That worked for me (Mac OS X)! Thank you!

That did the trick and I also had to launch ‘ionic cordova build android’ twice to actually see the app, but nevertheless It worked. Thank you!

That worked !..

worked for me, thanks!

This is definitely it. Remove all API 26 devices in your AVD control. This is in Android Studio under Tools|Android|AVD Manager. There may be other API versions that cause this, but definitely 26.

Had the same problem with 26 and 27. Remove all of the AVDs, install a SDK 25 and you’ll be good to go

@ahwell thank you this worked perfectly for me

Thanks @ahwell, it worked for me as well.

I have same problem.

What is the solution please???