【发布时间】:2018-11-28 13:39:23
【问题描述】:
我一直在竭尽全力为 ios 和 android 构建我的 ionic 应用程序。我已经多次添加和删除平台。升级和降级了我的 ionic 应用程序和 java JDK,但没有任何效果。现在常见的错误似乎与插件“cordova-custom-config”有关。
当尝试通过命令$ sudo ionic cordova platform add ios@latest --fetch --save --verbose添加ios平台时,错误是:
Discovered plugin "cordova-custom-config" in config.xml. Adding it to the project
Failed to restore plugin "cordova-custom-config" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin cordova-custom-config@^5.0.1 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code 1
npm ERR! Command failed: /usr/local/bin/git clone -q git://github.com/xiangpingmeng/plist.js.git /Users/adamgoldberg/.npm/_cacache/tmp/git-clone-87b2ddaf
npm ERR! /Users/adamgoldberg/.npm/_cacache/tmp/git-clone-87b2ddaf/.git: Permission denied
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/adamgoldberg/.npm/_logs/2018-02-07T04_04_30_105Z-debug.log
--save flag or autosave detected
Saving ios@latest into config.xml file ...
[ERROR] Exception:
尝试通过$ sudo ionic cordova platform add android@6.3.0 --fetch --save --verbose the error 命令添加android 平台时与ios 相同。请注意,我添加的是 android@6.3.0 而不是 android@latest,因为最新 (7.0.0) 有问题。
当我尝试通过命令$ sudo cordova plugin add cordova-custom-config --fetch --verbose 自行添加 cordova-custom-config 插件时,错误是:
(node:16626) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Failed to fetch plugin cordova-custom-config@^5.0.1 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code 1
npm ERR! Command failed: /usr/local/bin/git clone -q git://github.com/xiangpingmeng/plist.js.git /Users/adamgoldberg/.npm/_cacache/tmp/git-clone-0ad7ea7b
npm ERR! /Users/adamgoldberg/.npm/_cacache/tmp/git-clone-0ad7ea7b/.git: Permission denied
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/adamgoldberg/.npm/_logs/2018-02-07T04_12_20_482Z-debug.log
(node:16626) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
这是我的ionic info
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
ios-sim : 6.0.0
Node : v8.8.1
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : /Users/adamgoldberg/Library/Android/sdk
Misc:
backend : pro
【问题讨论】: