我正在使用VSTS进行IOS构建,运行命令后出现以下错误:cordova build ios
平台" android"似乎不是一个有效的cordova平台。它缺少API.js.不支持android。
Cordova版本:7.1.0
在Macos代理上运行它。同样适用于Android应用程序,但对于IOS,它给出以下错误。
日志:
2018-01-08T08:47:31.4862230Z ##[debug]loading inputs and endpoints
2018-01-08T08:47:31.4883290Z ##[debug]loading INPUT_PLATFORM
2018-01-08T08:47:31.4904030Z ##[debug]loading INPUT_CONFIGURATION
2018-01-08T08:47:31.4925020Z ##[debug]loading INPUT_CORDOVAVERSION
2018-01-08T08:47:31.4945860Z ##[debug]loading INPUT_ANTBUILD
2018-01-08T08:47:31.4966750Z ##[debug]loading INPUT_KEYSTOREFILE
2018-01-08T08:47:31.4987460Z ##[debug]loading INPUT_IOSSIGNMETHOD
2018-01-08T08:47:31.5009210Z ##[debug]loading INPUT_P12
2018-01-08T08:47:31.5030070Z ##[debug]loading INPUT_UNLOCKDEFAULTKEYCHAIN
2018-01-08T08:47:31.5050630Z ##[debug]loading INPUT_PROVPROFILE
2018-01-08T08:47:31.5071250Z ##[debug]loading INPUT_REMOVEPROFILE
2018-01-08T08:47:31.5091830Z ##[debug]loading INPUT_WINDOWSPHONEONLY
2018-01-08T08:47:31.5112430Z ##[debug]loading INPUT_WINDOWSONLY
2018-01-08T08:47:31.5133220Z ##[debug]loading INPUT_CWD
2018-01-08T08:47:31.5153800Z ##[debug]loading INPUT_OUTPUTPATTERN
2018-01-08T08:47:31.5175590Z ##[debug]loading INPUT_TARGETEMULATOR
2018-01-08T08:47:31.5198350Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2018-01-08T08:47:31.5219940Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2018-01-08T08:47:31.5242140Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2018-01-08T08:47:31.5264390Z ##[debug]loading SECRET_CODE-PUSH-ACCESS-KEY
2018-01-08T08:47:31.5285960Z ##[debug]loaded 19
2018-01-08T08:47:31.5307600Z ##[debug]BUILD_SOURCEDIRECTORY=undefined
2018-01-08T08:47:31.5329380Z ##[debug]BUILD_SOURCESDIRECTORY=/Users/vsts/agent/2.126.0/work/13/s
2018-01-08T08:47:31.5351720Z ##[debug]CWD=/Users/vsts/agent/2.126.0/work/13/s/dev-branch/src/Alcami.Web/cordova
2018-01-08T08:47:31.5372600Z ##[debug]XCODEDEVELOPERDIR=null
2018-01-08T08:47:31.5393140Z ##[debug]CONFIGURATION=$(Configuration)
2018-01-08T08:47:31.5413230Z ##[debug]ARCHS=null
2018-01-08T08:47:31.5433270Z ##[debug]PLATFORM=ios
2018-01-08T08:47:31.5453660Z ##[debug]TARGETEMULATOR=false
2018-01-08T08:47:31.5474170Z ##[debug]WINDOWSAPPX=null
2018-01-08T08:47:31.5494620Z ##[debug]WINDOWSONLY=false
2018-01-08T08:47:31.5517410Z ##[debug]WINDOWSPHONEONLY=false
2018-01-08T08:47:31.5539710Z ##[debug]UNLOCKDEFAULTKEYCHAIN=false
2018-01-08T08:47:31.5561560Z ##[debug]DEFAULTKEYCHAINPASSWORD=null
2018-01-08T08:47:31.5582810Z ##[debug]P12=/Users/vsts/agent/2.126.0/work/13/s
2018-01-08T08:47:31.5603950Z ##[debug]P12PWD=null
2018-01-08T08:47:31.5625110Z ##[debug]IOSSIGNINGIDENTITY=null
2018-01-08T08:47:31.5645720Z ##[debug]PROVPROFILEUUID=null
2018-01-08T08:47:31.5667270Z ##[debug]PROVPROFILE=/Users/vsts/agent/2.126.0/work/13/s
2018-01-08T08:47:31.5693190Z ##[debug]REMOVEPROFILE=false
2018-01-08T08:47:31.5714540Z ##[debug]ANTBUILD=false
2018-01-08T08:47:31.5735860Z ##[debug]KEYSTOREFILE=/Users/vsts/agent/2.126.0/work/13/s
2018-01-08T08:47:31.5757280Z ##[debug]KEYSTOREPASS=null
2018-01-08T08:47:31.5778920Z ##[debug]KEYSTOREALIAS=null
2018-01-08T08:47:31.5800080Z ##[debug]KEYPASS=null
2018-01-08T08:47:31.5821180Z ##[debug]OUTPUTPATTERN=bin
2018-01-08T08:47:31.5842450Z ##[debug]CORDOVAARGS=null
2018-01-08T08:47:31.5863640Z ##[debug]CORDOVAVERSION=7.1.0
2018-01-08T08:47:31.7683300Z Input to determineIdentity: {"cwd":"/Users/vsts/agent/2.126.0/work/13/s/dev-branch/src/Alcami.Web/cordova","unlockDefaultKeychain":false,"defaultKeychainPassword":"","p12":"/Users/vsts/agent/2.126.0/work/13/s","p12pwd":""}
2018-01-08T08:47:31.7697670Z p12 not specified in task.
2018-01-08T08:47:31.7716980Z determineIdentity result {}
2018-01-08T08:47:31.7730320Z No explicit signing identity specified in task.
2018-01-08T08:47:31.7745530Z Input to determineProfile: {"cwd":"/Users/vsts/agent/2.126.0/work/13/s/dev-branch/src/Alcami.Web/cordova","provProfileUuid":"","provProfilePath":"/Users/vsts/agent/2.126.0/work/13/s","removeProfile":false}
2018-01-08T08:47:31.7760580Z determineProfile result {"uuid":""}
2018-01-08T08:47:31.7775940Z Module cache at /Users/vsts/.taco_home/node_modules
2018-01-08T08:47:32.4808290Z cordova@7.1.0 already installed.
2018-01-08T08:47:35.2355330Z Module cache at /Users/vsts/.taco_home/node_modules
2018-01-08T08:47:35.8792230Z cordova@7.1.0 already installed.
2018-01-08T08:47:36.0986510Z Adding support plugin.
2018-01-08T08:47:37.4049580Z { Error: Uncaught, unspecified "error" event. (The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.)
2018-01-08T08:47:37.4063840Z at EventEmitter.emit (events.js:163:17)
2018-01-08T08:47:37.4078380Z at EventEmitter.module.exports.emit (/Users/vsts/.taco_home/node_modules/cordova/7.1.0/node_modules/cordova-common/src/events.js:71:17)
2018-01-08T08:47:37.4094150Z at Object.getPlatformApiFunction (/Users/vsts/.taco_home/node_modules/cordova/7.1.0/node_modules/cordova-lib/src/cordova/util.js:500:20)
2018-01-08T08:47:37.4109090Z at Object.getPlatformApi (/Users/vsts/.taco_home/node_modules/cordova/7.1.0/node_modules/cordova-lib/src/platforms/platforms.js:55:25)
2018-01-08T08:47:37.4124680Z at handleInstall (/Users/vsts/.taco_home/node_modules/cordova/7.1.0/node_modules/cordova-lib/src/plugman/install.js:593:29)
2018-01-08T08:47:37.4139810Z at /Users/vsts/.taco_home/node_modules/cordova/7.1.0/node_modules/cordova-lib/src/plugman/install.js:357:28
2018-01-08T08:47:37.4154720Z at _fulfilled (/Users/vsts/.taco_home/node_modules/cordova/7.1.0/node_modules/q/q.js:787:54)
2018-01-08T08:47:37.4169100Z at self.promiseDispatch.done (/Users/vsts/.taco_home/node_modules/cordova/7.1.0/node_modules/q/q.js:816:30)
2018-01-08T08:47:37.4184670Z at Promise.promise.promiseDispatch (/Users/vsts/.taco_home/node_modules/cordova/7.1.0/node_modules/q/q.js:749:13)
2018-01-08T08:47:37.4200220Z at /Users/vsts/.taco_home/node_modules/cordova/7.1.0/node_modules/q/q.js:509:49
2018-01-08T08:47:37.4215250Z context: 'The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.' }
2018-01-08T08:47:37.4237540Z ##[debug]task result: Failed
2018-01-08T08:47:37.4340660Z ##[error]Task failed
答案 0 :(得分:0)
我已经解决了我的问题。实际上问题是config.xml。我使用的是用于android的config.xml。