简体   繁体   English

离子安卓模拟器

[英]Ionic Android Emulator

I'm trying to run my IONIC application in the android emulator but it gives me this error all the time !!!我正在尝试在 android 模拟器中运行我的 IONIC 应用程序,但它一直给我这个错误!!! 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.


I have the same problem and then I started Android Studio and run the emulator.我遇到了同样的问题,然后我启动了 Android Studio 并运行了模拟器。

With the emulator running, I executed:在模拟器运行的情况下,我执行了:

ionic cordova emulate android

And it works for me :)它对我有用:)

Try running尝试跑步

--no-native-run

if it not resolved install native run globally如果它没有解决安装本地运行全局

npm i -g native-run

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.我知道已经晚了,但也许有人仍在寻找它。

Try to manually create a Virtual Device via AVD manager from Android Studio.尝试通过 Android Studio 的AVD manager手动创建Virtual Device Maybe it is helpful to resolve your problem.也许它有助于解决您的问题。

ANDROID_HOMME 应该是 ANDROID_HOME

This error occurs when there are no devices created in the AVD manager.当 AVD 管理器中没有创建设备时,会发生此错误。 You can easily fix this issue by opening the android studio and creating a target(device) in the AVD manager.您可以通过打开 android studio 并在 AVD 管理器中创建目标(设备)来轻松解决此问题。 Select any of the available target devices, download install them in the same AVD manager window.选择任何可用的目标设备,在同一个 AVD 管理器窗口中下载安装它们。 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 -完成此操作后,您可以直接在 android studio 中通过选择调试选项来测试您的 SDK,然后导入您可以在以下位置找到的 apk -

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.但是根据 ionic 的说法,使用 Genymotion 进行仿真是比本地运行更好的选择,因为它太慢了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM