-
安装依赖
npm install

解决:安装了python2.7(版本python3+不行) -
再次
npm install

解决:以管理员身份在cmd运行npm install -global -production windows-build-tools参考:https://blog.youkuaiyun.com/xf1195718067/article/details/78598599?locationNum=8&fps=1
-
打包
cordova build android

Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.0.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.0.0.
> Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Could not GET 'https://maven.google.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom'.
> Connect to maven.google.com:443 [maven.google.com/203.208.41.63, maven.google.com/203.208.41.47, maven.google.com/203.208.41.55, maven.google.com/203.208.41.56] failed: Read timed out
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 26s
解决:网络的问题,有个source无法下载,放到能访问的服务器里才打包成功


本来是想做人脸识别项目的,最后没用这个,用的是小程序调用的百度ai接口做的0.o

本文记录了在安装ionic cordova项目并将其打包成apk过程中遇到的两个问题及解决方案:1) 安装python2.7解决与python3版本不兼容问题;2) 以管理员权限运行cmd解决命令执行失败问题;3) 针对网络问题,通过将无法下载的source放在可访问服务器上完成打包。最终项目未使用人脸识别,而是选择了小程序调用百度AI接口实现。
1131

被折叠的 条评论
为什么被折叠?



