2017-10-12 34 views
1

從今天起,我在離子添加android平臺時面臨一個問題。我無法在離子添加Android平臺

當我運行離子cordova平臺添加android我發現以下錯誤: 請幫我。

C:\用戶\卡邁勒\桌面\桌面>離子科爾多瓦平臺添加的Android

[INFO]啓用科爾多瓦整合。

ionic config set integrations.cordova {} --json --force [OK] integrations.cordova set to {} in .\ionic.config.json! cordova platform add android --save × Running command - failed! [ERROR] Exception: Using cordova-fetch for [email protected]~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 [email protected] 
    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 [email protected]~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 

回答

0

嘗試安裝6.11.4 LTS版本的Node.js的(標記爲建議大多數用戶)

+0

還是同樣的問題.. –

+0

您是否安裝Git的? –

+0

是的,我已經安裝了git。 –

相關問題