1. 程式人生 > >安裝ionic cordova專案並打包成apk中遇到的問題(安裝的是https://github.com/SilvaEmerson/face_recognition_app)

安裝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無法下載,放到能訪問的伺服器裡才打包成功
在這裡插入圖片描述