安装ionic cordova项目并打包成apk中遇到的问题(安装的是https://github.com/SilvaEmerson/face_recognition_app)

  1. 安装依赖npm install
    在这里插入图片描述
    解决:安装了python2.7(版本python3+不行)

  2. 再次npm install
    在这里插入图片描述
    解决:以管理员身份在cmd运行

    npm install -global -production windows-build-tools

    参考:https://blog.csdn.net/xf1195718067/article/details/78598599?locationNum=8&fps=1

  3. 打包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无法下载,放到能访问的服务器里才打包成功
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/kikyou_csdn/article/details/83150148