You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
抛出错误 [39012]:ERROR:./android/qt/qt_setup.cpp:28:Qt library not found at D:\android_sdk\emulator\lib64\qt\lib Could not launch 'D:\android_sdk\emulator/qemu/windows-x86_64/qemu-system-i386.exe': No such file or directory
应该是没有安装emulator吧,安装一下
然后安装 D:\android_sdk\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm-android.exe
有一个错误提示,可能是BIOS里要开启虚拟功能。
重启去BIOS里去设置。
安装时仍然有错误, This computer does not support Intel Virtualization Technology (VT-x) or it is being exclusively used by Hyper-V. HAXM cannot be installed. Please ensure Hyper-V is disabled in Windows Features, or refer to the Intel HAXM documentation for more information.
安装
cordova
测试
cordova
是否安装成功新建
cordova
项目格式如下,软件包名,项目名可省略
如
配置android sdk
不想安装几G的
Android studio
,则下载sdk tools
https://dl.google.com/android/repository/sdk-tools-windows-3859397.zip
解压到
D:\android_sdk
添加系统环境变量
ANDROID_HOME
=D:\android_sdk
系统环境变量
Path
里添加%ANDROID_HOME%\platform-tools
和
%ANDROID_HOME%\tools
进入目录
D:\android_sdk\tools\bin
看看可以安装哪些包
因为cordova 7.0.1默认的Android 编译目标版本为 25
所以应该安装 SDK 25
检测环境是否配置好
提示
Gradle
没有安装,下载 http://downloads.gradle.org/distributions/gradle-2.14.1-all.zip
解压到目录
C:\Users\abeet\.gradle\wrapper\dists\gradle-2.14.1
添加系统环境变量
GRADLE_HOME
=C:\Users\abeet\.gradle\wrapper\dists\gradle-2.14.1
系统环境变量
Path
里添加%GRADLE_HOME%\bin
测试Gradle是否配置好
添加平台
生成APK文件
遇到错误,下载
gradle 3.3
失败手工下载
http://downloads.gradle.org/distributions/gradle-3.3-all.zip
不用解压,放到到目录
C:\Users\abeet\.gradle\wrapper\dists\gradle-3.3-all\55gk2rcmfc6p2dg9u9ohc3hw9
再重新执行
下载各种jar包,等待半小时以上。
编译成功,则在项目目录下出现一个apk安装包。
[项目目录]/platforms/android/build/outputs/apk/android-debug.apk
可以用夜神模拟器进行测试。
直接运行
模拟器中运行APP
设备中运行APP
会抛出错误,因为没有安装模拟器。
创建AVD模拟器
查看当前支持版本 (在列出的版本中我们需要记住id值,这个值在第2步中使用)
创建AVD
此处为
./avdmanager create avd -n testAVD -k "system-images;android-25;google_apis;x86"
抛出错误
Error: Package path is not valid. Valid system image paths are:
原来是要先安装以下包
./sdkmanager "system-images;android-25;google_apis;x86"
要下载的文件很多,要等一个多小时,我甚至遇到磁盘空间不足的错误。。。。
再执行上面的创建avd命令,出现另外一个错误
Error: Invalid --tag default for the selected package.
命令改为
./avdmanager create avd -n testAVD -k "system-images;android-25;google_apis;x86" -g goole_apis
查看是否创建成功
成功创建了一个avd。
启动AVD模拟器
抛出错误
[39012]:ERROR:./android/qt/qt_setup.cpp:28:Qt library not found at D:\android_sdk\emulator\lib64\qt\lib Could not launch 'D:\android_sdk\emulator/qemu/windows-x86_64/qemu-system-i386.exe': No such file or directory
应该是没有安装
emulator
吧,安装一下./sdkmanager "emulator"
仍然有错误
emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure Intel HAXM is properly installed and usable. CPU acceleration status: HAXM is not installed on this machine
https://stackoverflow.com/questions/29136173/emulator-error-x86-emulation-currently-requires-hardware-acceleration
这个网页说要安装 Intel x86 Emulator Accelerator
然后安装 D:\android_sdk\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm-android.exe
有一个错误提示,可能是BIOS里要开启虚拟功能。
重启去BIOS里去设置。
安装时仍然有错误,
This computer does not support Intel Virtualization Technology (VT-x) or it is being exclusively used by Hyper-V. HAXM cannot be installed. Please ensure Hyper-V is disabled in Windows Features, or refer to the Intel HAXM documentation for more information.
在windows设置里搜索windows功能,停用Hyper-V。然后重启电脑。
终于安装成功。
再次执行
模拟器启动成功
在模拟器中运行app
修改图标
配置文件
config.xml
下面添加
模拟器尺寸太小
还没有解决
参考资料
http://cordova.axuer.com/docs/zh-cn/latest/guide/cli/index.html
cordova中文文档
http://blog.csdn.net/dsb2008dsb/article/details/52159361
cordova使用总结
http://blog.csdn.net/lovelyelfpop/article/details/24703069
使用chrome调试cordova app
The text was updated successfully, but these errors were encountered: