Reputation: 383
I'm trying to run my IONIC application in the android emulator but it gives me this error all the time !!! I set the
ANDROID_HOME=C:\Program Files\Android\Android Studio\bin,
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111
[native-run] No hardware devices found, attempting emulator...
[native-run] ERR_NO_TARGET: No targets devices/emulators available. Cannot create AVD because there is no suitable API installation. Use --sdk-info to reveal missing packages and other issues.
[ERROR] An error occurred while running subprocess native-run.
native-run.cmd android --app platforms\android\app\build\outputs\apk\debug\app-d... exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Upvotes: 10
Views: 15509
Reputation: 5322
Try to manually create a Virtual Device
via AVD manager
from Android Studio. Maybe it is helpful to resolve your problem.
Upvotes: 1
Reputation: 199
I have had the same problem. Then I tried opening the emulator and it worked perfectly. I know it's late but maybe someone is still looking for it.
Upvotes: 1
Reputation: 1083
This error occurs when there are no devices created in the AVD manager. You can easily fix this issue by opening the android studio and creating a target(device) in the AVD manager. Select any of the available target devices, download install them in the same AVD manager window. Once this is done, you can either test your SDK directly in the android studio by selecting the debug option and then importing your apk which can be found at -
platforms\android\app\build\outputs\apk\debug\
or come back and run the following command again -
ionic cordova emulate android
But as per ionic, using Genymotion for emulation is a better option than native-run as it is too slow.
Upvotes: 0
Reputation: 89
I have the same problem and then I started Android Studio and run the emulator.
With the emulator running, I executed:
ionic cordova emulate android
And it works for me :)
Upvotes: 8
Reputation: 5742
Try running
--no-native-run
if it not resolved install native run globally
npm i -g native-run
Upvotes: 3