-
安装依赖
npm install
解决:安装了python2.7(版本python3+不行) -
再次
npm install
解决:以管理员身份在cmd运行npm install -global -production windows-build-tools
参考:https://blog.csdn.net/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无法下载,放到能访问的服务器里才打包成功