"ionic run android" shows this error -> basic_string::_S_construct null not valid

I`m following this guide to install a new fresh Ionic2 here.

And I`m getting this error:

**ionic run android**
WARN: ionic.config.js has been deprecated, you can remove it.

Running 'run:before' gulp task before run
[09:25:31] Starting 'clean'...
[09:25:31] Finished 'clean' after 28 ms
[09:25:31] Starting 'build'...
[09:25:31] Starting 'sass'...
[09:25:31] Starting 'html'...
[09:25:31] Starting 'fonts'...
[09:25:31] Starting 'scripts'...
[09:25:31] Finished 'scripts' after 56 ms
[09:25:31] Finished 'html' after 70 ms
[09:25:31] Finished 'fonts' after 94 ms
[09:25:32] Finished 'sass' after 1.21 s
[09:25:50] Finished 'build' after 19 s
[09:25:50] Starting 'run:before'...
[09:25:50] Finished 'run:before' after 18 μs

• You're trying to build for android, but don't have the platform installed yet.
∆ Installing android for you.
√ Installed platform android
Installing cordova-plugin-device
Installing cordova-plugin-console
Installing cordova-plugin-whitelist
Installing cordova-plugin-splashscreen
Installing cordova-plugin-statusbar
Installing ionic-plugin-keyboard
Running command: C:\Server\nodejs\node.exe C:\#Temp\testeApp\hooks\after_prepare\010_add_platform_class.js C:\#Temp\testeApp
add to body class: platform-android
JAVA_HOME=C:\Program Files\java\jdk1.8.0_77
No target specified, deploying to emulator
No emulator specified, defaulting to Aloteste
Waiting for emulator...
terminate called after throwing an instance of std::logic_error
  what():  basic_string::_S_construct null not valid

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.


**ionic info**
WARN: ionic.config.js has been deprecated, you can remove it.

Your system information:

Cordova CLI: 6.1.1
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.4
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS: Windows 7 SP1
Node Version: v5.7.1

Any ideas? Should I install a previous version of jdk?

It looks like it may just be a bad build since it was trying to load the emulator (which can be painfully slow)

You probably will have better luck if you attached a real device and run ionic run android --device

What are the specifications that “Alteste” emulator has?
Can you try with a general device with lollipop or try with a real device? Is the same output?

Mike, b1x1t0, Thanks for helping out. It is now working. :slight_smile:

  1. “Altteste” was probably some mistake that I’ve done… So:

  2. I re-installed GenyMotion, checked if everything worked doing adb devices

  3. used ionic run android --device --target=0020584193 to deploy to GenyMotion - It worked!

  4. I`m now getting some issues deploying on real devices (Moto G). It’s deploying fine, but the behavior is wiard (blank-view), but this problem is now out-of-this-topic (It seems a ng2/ts problem). Well, I will keep searching to see why this is happening, probably some n00b mistake again.

Thanks once again guys!


I had same issue and the cause was due to absence of emulator. I created one and this issue resolved.

Update: It seems like it was resolved for a time being… I am still facing this issue… Any help please…