1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VSTS-CIのCordova-iOSビルドで「TypeError: "file" argument must be a non-empty string」エラーが発生した時の対処法

Last updated at Posted at 2018-04-06

:one: 環境

  • VSTS (Visual Studio Team Services) CIサービス (無料プラン)
  • Agent: Hosted macOS Preview
  • Node.js: v8.9.3
  • cordova: v7.1.0
  • cordova-ios: 4.5.4

:two: エラー内容

VSTS-CI にてCordovaのiOSビルドを実行すると「TypeError: "file" argument must be a non-empty string」エラーが発生する。

エラーログの内容
2018-04-05T09:54:52.1074750Z ##[section]Starting: Cordova Build ios
2018-04-05T09:54:52.1134170Z ==============================================================================
2018-04-05T09:54:52.1147800Z Task         : Cordova Build
2018-04-05T09:54:52.1161490Z Description  : Build a hybrid app project based on the Cordova CLI, Ionic CLI, TACO CLI, or other Cordova-compliant CLI
2018-04-05T09:54:52.1175080Z Version      : 1.3.11
2018-04-05T09:54:52.1189080Z Author       : Microsoft Corporation
2018-04-05T09:54:52.1203190Z Help         : [More Information](http://go.microsoft.com/fwlink/?LinkID=691186)
2018-04-05T09:54:52.1217550Z ==============================================================================
2018-04-05T09:54:52.7905950Z Input to determineIdentity: {"cwd":"/Users/vsts/agent/2.131.0/work/1/s","unlockDefaultKeychain":false,"defaultKeychainPassword":"","p12":"/Users/vsts/agent/2.131.0/work/1/s/keys/ios/ios_development.p12","p12pwd":"******"}
2018-04-05T09:54:52.7985870Z TypeError: "file" argument must be a non-empty string
2018-04-05T09:54:52.8001100Z     at normalizeSpawnArguments (child_process.js:383:11)
2018-04-05T09:54:52.8014630Z     at spawnSync (child_process.js:519:38)
2018-04-05T09:54:52.8030420Z     at /Users/vsts/agent/2.131.0/work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/lib/xcode-task-utils.js:45:31
2018-04-05T09:54:52.8048720Z     at _fulfilled (/Users/vsts/agent/2.131.0/work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:854:54)
2018-04-05T09:54:52.8067550Z     at self.promiseDispatch.done (/Users/vsts/agent/2.131.0/work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:883:30)
2018-04-05T09:54:52.8083360Z     at Promise.promise.promiseDispatch (/Users/vsts/agent/2.131.0/work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:816:13)
2018-04-05T09:54:52.8097860Z     at /Users/vsts/agent/2.131.0/work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:877:14
2018-04-05T09:54:52.8114090Z     at runSingle (/Users/vsts/agent/2.131.0/work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:137:13)
2018-04-05T09:54:52.8136430Z     at flush (/Users/vsts/agent/2.131.0/work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:125:13)
2018-04-05T09:54:52.8161640Z     at _combinedTickCallback (internal/process/next_tick.js:131:7)
2018-04-05T09:54:52.8278070Z ##[error]Task failed
2018-04-05T09:54:52.8687900Z ##[section]Finishing: Cordova Build ios

:three: 原因

Microsoft/vsts-cordova-tasksの不具合っぽい。
GitHub (https://github.com/Microsoft/vsts-cordova-tasks/issues/79) にもIssuesが上がっていたが現時点で解決していない。ただ、Node.js v7.x で動作したとの情報が載っていた。

:four: 対応

VSTS-CI のNode.jsのバージョンを v8.9.3 から v6.14.1 に変更。
そもそも初期値はv6なので、変更していなければこのエラーは発生しない。
1.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?