我无法在离子中添加android平台

时间:2017-10-12 10:42:54

标签: android ionic-framework ionic2 ionic3

从今天开始,我面临着离子加载android平台的问题。

当我运行离子cordova平台添加android 时,我发现以下错误: 请帮帮我。

C:\ Users \ kamal \ Desktop \ desktop> ionic cordova platform add android

[INFO]启用Cordova集成。

  

ionic config set integrations.cordova {} --json --force   [OK] integrations.cordova在。\ ionic.config.json中设置为{}!   cordova平台添加android --save   ×运行命令 - 失败!   [ERROR]例外:使用cordova-fetch for cordova-android@~6.3.0

    Adding android project...
    Creating Cordova project for the Android platform:
            Path: platforms\android
            Package: io.ionic.starter
            Name: MyApp
            Activity: MainActivity
            Android target: android-26
    Subproject Path: CordovaLib
    Android project created with cordova-android@6.3.0
    Discovered plugin "ionic-plugin-keyboard" in config.xml. Adding it to the project
    Installing "ionic-plugin-keyboard" for android
    Adding ionic-plugin-keyboard to package.json
    Saved plugin info for "ionic-plugin-keyboard" to config.xml
    Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
    Installing "cordova-plugin-whitelist" for android

                    This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a
    previous platform version, you do *not* need this plugin since the whitelist will be built in.

    Adding cordova-plugin-whitelist to package.json
    Saved plugin info for "cordova-plugin-whitelist" to config.xml
    Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project
    Failed to restore plugin "cordova-plugin-statusbar" from config.xml. You might need to try adding it again.
    Error: Failed to fetch plugin https://github.com/apache/cordova-plugin-statusbar.git via registry.
    Probably this is either a connection problem, or plugin spec is incorrect.
    Check your connection and plugin name/version/URL.
    Error: cmd: Command failed with exit code 1 Error output:
    npm ERR! git clone
    C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
    C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:
    Cloning into
    'C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892'...
    npm ERR! git clone
    C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
    C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:
    git-upload-pack
    'C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92':
    git-upload-pack: command not found
    npm ERR! git clone
    C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
    C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:
    fatal: Could not read from remote repository.
    npm ERR! git clone
    C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
    C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:

    npm ERR! git clone
    C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
    C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:
    Please make sure you have the correct access rights
    npm ERR! git clone
    C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
    C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:
    and the repository exists.
    npm ERR! git clone
    C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
    C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:

    npm ERR! Windows_NT 10.0.10240
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
    Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
    "https://github.com/apache/cordova-plugin-statusbar.git" "--production" "--save"
    npm ERR! node v6.11.4
    npm ERR! npm  v3.10.10
    npm ERR! code 128

    npm ERR! Command failed: git -c core.longpaths=true clone
    C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
    C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892
    npm ERR! Cloning into
    'C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892'...
    npm ERR! git-upload-pack
    'C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92':
    git-upload-pack: command not found
    npm ERR! fatal: Could not read from remote repository.
    npm ERR!
    npm ERR! Please make sure you have the correct access rights
    npm ERR! and the repository exists.
    npm ERR!
    npm ERR!
    npm ERR! If you need help, you may report this error at:
    npm ERR!     <https://github.com/npm/npm/issues>

    npm ERR! Please include the following file with any support request:
    npm ERR!     C:\Users\kamal\Desktop\desktop\npm-debug.log
    Discovered plugin "cordova-plugin-device" in config.xml. Adding it to the project
    Installing "cordova-plugin-device" for android
    Adding cordova-plugin-device to package.json
    Saved plugin info for "cordova-plugin-device" to config.xml
    Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project
    Installing "cordova-plugin-splashscreen" for android
    Adding cordova-plugin-splashscreen to package.json
    Saved plugin info for "cordova-plugin-splashscreen" to config.xml
    Discovered plugin "cordova-plugin-ionic-webview" in config.xml. Adding it to the project
    Installing "cordova-plugin-ionic-webview" for android
    Adding cordova-plugin-ionic-webview to package.json
    Saved plugin info for "cordova-plugin-ionic-webview" to config.xml
    --save flag or autosave detected
    Saving android@~6.3.0 into config.xml file ...

我的离子信息

@ionic/cli-utils  : 1.13.0
ionic (Ionic CLI) : 3.13.0

全球套餐:

cordova (Cordova CLI) : 7.1.0

本地包裹:

@ionic/app-scripts : 3.0.0
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.7.1

系统:

Android SDK Tools : 26.1.1
Node              : v6.11.4
npm               : 3.10.10
OS                : Windows 10

其他:

backend : pro

1 个答案:

答案 0 :(得分:0)

尝试安装6.11.4 LTS版本的node.js(标记为大多数用户推荐)