VSTS Cordova Android 构建作业卡住了
VSTS Cordova Android Build Job stuck
使用托管 VS2017 机器进行 ionic / cordova 构建作业,无论我似乎做了什么更改,它都会卡住:
Queueing build for platform android w/options: --release,--device,--gradleArg=--no-daemon
Processing res/native for android
add to body class: platform-android
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_172
Welcome to Gradle 4.8!
Here are the highlights of this release:
- Dependency locking
- Maven Publish and Ivy Publish plugins improved and marked stable
- Incremental annotation processing enhancements
- APIs to configure tasks at creation time
For more details see https://docs.gradle.org/4.8/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :wrapper
BUILD SUCCESSFUL in 34s
1 actionable task: 1 executed
我在 VSTS 文档中读到 gradle 守护程序会卡住,因此您应该在 after_compile 文件夹中添加一个挂钩
IF EXIST platforms\android platforms\android\gradlew --stop
但这似乎也不起作用。我尝试删除 build.json 中的代码签名,但这似乎也无济于事,我什至尝试通过 npm
引导整个过程
npm run cordova -- build android --release --device --gradleArg=--no-daemon
同样的问题。我在 taco.json 中尝试了 Cordova 6.5.0、7.1.0 和 8.0.0,同样的问题。我真的觉得是 gradle 守护进程卡住了,但钩子被忽略了,或者它们被更改了,我只是找不到它们现在应该去哪里或去哪里。
构建定义:
{
"badgeEnabled": null,
"buildNumberFormat": null,
"comment": null,
"createdDate": "2018-07-18T15:31:11.333000+00:00",
"demands": null,
"description": null,
"draftOf": null,
"dropLocation": null,
"id": ,
"jobAuthorizationScope": "projectCollection",
"jobCancelTimeoutInMinutes": 5,
"jobTimeoutInMinutes": 60,
"latestBuild": null,
"latestCompletedBuild": null,
"metrics": null,
"name": "Mobile Builds",
"path": "\project",
"process": {
"phases": [
{
"condition": "succeeded()",
"jobAuthorizationScope": "projectCollection",
"jobCancelTimeoutInMinutes": 1,
"name": "Android",
"refName": "Phase_1",
"steps": [
{
"alwaysRun": false,
"condition": "succeeded()",
"continueOnError": false,
"displayName": "install",
"enabled": true,
"environment": {},
"inputs": {
"command": "install",
"customCommand": "",
"customEndpoint": "",
"customFeed": "",
"customRegistry": "useNpmrc",
"publishEndpoint": "",
"publishFeed": "",
"publishRegistry": "useExternalRegistry",
"verbose": "false",
"workingDir": "WorkDir"
},
"task": {
"definitionType": "task",
"id": "fe47e961-9fa8-4106-8639-368c022d43ad",
"versionSpec": "1.*"
},
"timeoutInMinutes": 0
},
{
"alwaysRun": false,
"condition": "succeeded()",
"continueOnError": false,
"displayName": "gulp sass",
"enabled": true,
"environment": {},
"inputs": {
"command": "custom",
"customCommand": "run gulp -- sass",
"customEndpoint": "",
"customFeed": "",
"customRegistry": "useNpmrc",
"publishEndpoint": "",
"publishFeed": "",
"publishRegistry": "useExternalRegistry",
"verbose": "false",
"workingDir": "WorkDir"
},
"task": {
"definitionType": "task",
"id": "fe47e961-9fa8-4106-8639-368c022d43ad",
"versionSpec": "1.*"
},
"timeoutInMinutes": 0
},
{
"alwaysRun": false,
"condition": "succeeded()",
"continueOnError": false,
"displayName": "Cordova Build android",
"enabled": true,
"environment": {},
"inputs": {
"antBuild": "false",
"archs": "",
"configuration": "release",
"cordovaArgs": "",
"cordovaVersion": "",
"cwd": "WorkDir",
"defaultKeychainPassword": "",
"iosSignMethod": "file",
"iosSigningIdentity": "",
"keyPass": "",
"keystoreAlias": "",
"keystoreFile": "",
"keystorePass": "",
"outputPattern": "bin",
"p12": "",
"p12pwd": "",
"platform": "android",
"provProfile": "",
"provProfileUuid": "",
"removeProfile": "false",
"targetEmulator": "false",
"unlockDefaultKeychain": "false",
"windowsAppx": "",
"windowsOnly": "false",
"windowsPhoneOnly": "false",
"xcodeDeveloperDir": ""
},
"task": {
"definitionType": "task",
"id": "70e94267-15dc-434d-8973-023d766825d7",
"versionSpec": "1.*"
},
"timeoutInMinutes": 0
},
{
"alwaysRun": false,
"condition": "succeeded()",
"continueOnError": false,
"displayName": "Copy Release Notes to Android Build Folder",
"enabled": true,
"environment": {},
"inputs": {
"CleanTargetFolder": "false",
"Contents": "release-notes.txt",
"OverWrite": "false",
"SourceFolder": "WorkDir",
"TargetFolder": "bin/Android/Release",
"flattenFolders": "false"
},
"task": {
"definitionType": "task",
"id": "5bfb729a-a7c8-4a78-a7c3-8d717bb7c13c",
"versionSpec": "2.*"
},
"timeoutInMinutes": 0
},
{
"alwaysRun": false,
"condition": "succeeded()",
"continueOnError": false,
"displayName": "Publish Artifact: Android",
"enabled": true,
"environment": {},
"inputs": {
"ArtifactName": "Android",
"ArtifactType": "Container",
"Parallel": "false",
"ParallelCount": "8",
"PathtoPublish": "WorkDir/bin/Android/Release",
"TargetPath": ""
},
"task": {
"definitionType": "task",
"id": "2ff763a7-ce83-4e1f-bc89-0ae63477cebe",
"versionSpec": "1.*"
},
"timeoutInMinutes": 0
}
],
"target": {
"allowScriptsAuthAccessOption": false,
"executionOptions": {
"type": 0
},
"type": 1
}
}
],
"type": 1
},
"processParameters": {
"additionalProperties": {},
"dataSourceBindings": null,
"inputs": null,
"sourceDefinitions": null
},
"properties": {},
"quality": "definition",
"queue": {
"additionalProperties": {},
"id": 288,
"name": "Hosted VS2017",
"pool": {
"additionalProperties": {},
"id": 10,
"isHosted": true,
"name": "Hosted VS2017"
},
"url": "https://account.visualstudio.com/_apis/build/Queues/288"
},
"queueStatus": "enabled",
"repository": {
"additionalProperties": {},
"checkoutSubmodules": false,
"clean": "false",
"defaultBranch": "refs/heads/master",
"id": "ce667db8-941e-47a6-b191-3cb5cf478f69",
"name": "repo",
"properties": {
"checkoutNestedSubmodules": "false",
"cleanOptions": "0",
"fetchDepth": "0",
"gitLfsSupport": "false",
"labelSources": "0",
"labelSourcesFormat": "$(build.buildNumber)",
"reportBuildStatus": "true",
"skipSyncSource": "false"
},
"rootFolder": null,
"type": "TfsGit",
"url": "https://account.visualstudio.com/project/_git/repo"
},
"revision": 15,
"tags": [],
"triggers": null,
"type": "build",
"uri": "vstfs:///Build/Definition/160",
"url": "https://account.visualstudio.com/guid/_apis/build/Definitions/160?revision=15",
"variableGroups": null,
"variables": {
"system.debug": {
"additionalProperties": {},
"allowOverride": true,
"isSecret": null,
"value": "false"
}
}
}
我们的 ionic 1 项目在 hooks 目录中有一堆奇怪的钩子脚本,我认为此时已经在 cordova 构建过程中实现了。清理我们的 hooks 目录,只保留必要的内容来解决这个问题。
使用托管 VS2017 机器进行 ionic / cordova 构建作业,无论我似乎做了什么更改,它都会卡住:
Queueing build for platform android w/options: --release,--device,--gradleArg=--no-daemon
Processing res/native for android
add to body class: platform-android
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_172
Welcome to Gradle 4.8!
Here are the highlights of this release:
- Dependency locking
- Maven Publish and Ivy Publish plugins improved and marked stable
- Incremental annotation processing enhancements
- APIs to configure tasks at creation time
For more details see https://docs.gradle.org/4.8/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :wrapper
BUILD SUCCESSFUL in 34s
1 actionable task: 1 executed
我在 VSTS 文档中读到 gradle 守护程序会卡住,因此您应该在 after_compile 文件夹中添加一个挂钩
IF EXIST platforms\android platforms\android\gradlew --stop
但这似乎也不起作用。我尝试删除 build.json 中的代码签名,但这似乎也无济于事,我什至尝试通过 npm
引导整个过程npm run cordova -- build android --release --device --gradleArg=--no-daemon
同样的问题。我在 taco.json 中尝试了 Cordova 6.5.0、7.1.0 和 8.0.0,同样的问题。我真的觉得是 gradle 守护进程卡住了,但钩子被忽略了,或者它们被更改了,我只是找不到它们现在应该去哪里或去哪里。
构建定义:
{
"badgeEnabled": null,
"buildNumberFormat": null,
"comment": null,
"createdDate": "2018-07-18T15:31:11.333000+00:00",
"demands": null,
"description": null,
"draftOf": null,
"dropLocation": null,
"id": ,
"jobAuthorizationScope": "projectCollection",
"jobCancelTimeoutInMinutes": 5,
"jobTimeoutInMinutes": 60,
"latestBuild": null,
"latestCompletedBuild": null,
"metrics": null,
"name": "Mobile Builds",
"path": "\project",
"process": {
"phases": [
{
"condition": "succeeded()",
"jobAuthorizationScope": "projectCollection",
"jobCancelTimeoutInMinutes": 1,
"name": "Android",
"refName": "Phase_1",
"steps": [
{
"alwaysRun": false,
"condition": "succeeded()",
"continueOnError": false,
"displayName": "install",
"enabled": true,
"environment": {},
"inputs": {
"command": "install",
"customCommand": "",
"customEndpoint": "",
"customFeed": "",
"customRegistry": "useNpmrc",
"publishEndpoint": "",
"publishFeed": "",
"publishRegistry": "useExternalRegistry",
"verbose": "false",
"workingDir": "WorkDir"
},
"task": {
"definitionType": "task",
"id": "fe47e961-9fa8-4106-8639-368c022d43ad",
"versionSpec": "1.*"
},
"timeoutInMinutes": 0
},
{
"alwaysRun": false,
"condition": "succeeded()",
"continueOnError": false,
"displayName": "gulp sass",
"enabled": true,
"environment": {},
"inputs": {
"command": "custom",
"customCommand": "run gulp -- sass",
"customEndpoint": "",
"customFeed": "",
"customRegistry": "useNpmrc",
"publishEndpoint": "",
"publishFeed": "",
"publishRegistry": "useExternalRegistry",
"verbose": "false",
"workingDir": "WorkDir"
},
"task": {
"definitionType": "task",
"id": "fe47e961-9fa8-4106-8639-368c022d43ad",
"versionSpec": "1.*"
},
"timeoutInMinutes": 0
},
{
"alwaysRun": false,
"condition": "succeeded()",
"continueOnError": false,
"displayName": "Cordova Build android",
"enabled": true,
"environment": {},
"inputs": {
"antBuild": "false",
"archs": "",
"configuration": "release",
"cordovaArgs": "",
"cordovaVersion": "",
"cwd": "WorkDir",
"defaultKeychainPassword": "",
"iosSignMethod": "file",
"iosSigningIdentity": "",
"keyPass": "",
"keystoreAlias": "",
"keystoreFile": "",
"keystorePass": "",
"outputPattern": "bin",
"p12": "",
"p12pwd": "",
"platform": "android",
"provProfile": "",
"provProfileUuid": "",
"removeProfile": "false",
"targetEmulator": "false",
"unlockDefaultKeychain": "false",
"windowsAppx": "",
"windowsOnly": "false",
"windowsPhoneOnly": "false",
"xcodeDeveloperDir": ""
},
"task": {
"definitionType": "task",
"id": "70e94267-15dc-434d-8973-023d766825d7",
"versionSpec": "1.*"
},
"timeoutInMinutes": 0
},
{
"alwaysRun": false,
"condition": "succeeded()",
"continueOnError": false,
"displayName": "Copy Release Notes to Android Build Folder",
"enabled": true,
"environment": {},
"inputs": {
"CleanTargetFolder": "false",
"Contents": "release-notes.txt",
"OverWrite": "false",
"SourceFolder": "WorkDir",
"TargetFolder": "bin/Android/Release",
"flattenFolders": "false"
},
"task": {
"definitionType": "task",
"id": "5bfb729a-a7c8-4a78-a7c3-8d717bb7c13c",
"versionSpec": "2.*"
},
"timeoutInMinutes": 0
},
{
"alwaysRun": false,
"condition": "succeeded()",
"continueOnError": false,
"displayName": "Publish Artifact: Android",
"enabled": true,
"environment": {},
"inputs": {
"ArtifactName": "Android",
"ArtifactType": "Container",
"Parallel": "false",
"ParallelCount": "8",
"PathtoPublish": "WorkDir/bin/Android/Release",
"TargetPath": ""
},
"task": {
"definitionType": "task",
"id": "2ff763a7-ce83-4e1f-bc89-0ae63477cebe",
"versionSpec": "1.*"
},
"timeoutInMinutes": 0
}
],
"target": {
"allowScriptsAuthAccessOption": false,
"executionOptions": {
"type": 0
},
"type": 1
}
}
],
"type": 1
},
"processParameters": {
"additionalProperties": {},
"dataSourceBindings": null,
"inputs": null,
"sourceDefinitions": null
},
"properties": {},
"quality": "definition",
"queue": {
"additionalProperties": {},
"id": 288,
"name": "Hosted VS2017",
"pool": {
"additionalProperties": {},
"id": 10,
"isHosted": true,
"name": "Hosted VS2017"
},
"url": "https://account.visualstudio.com/_apis/build/Queues/288"
},
"queueStatus": "enabled",
"repository": {
"additionalProperties": {},
"checkoutSubmodules": false,
"clean": "false",
"defaultBranch": "refs/heads/master",
"id": "ce667db8-941e-47a6-b191-3cb5cf478f69",
"name": "repo",
"properties": {
"checkoutNestedSubmodules": "false",
"cleanOptions": "0",
"fetchDepth": "0",
"gitLfsSupport": "false",
"labelSources": "0",
"labelSourcesFormat": "$(build.buildNumber)",
"reportBuildStatus": "true",
"skipSyncSource": "false"
},
"rootFolder": null,
"type": "TfsGit",
"url": "https://account.visualstudio.com/project/_git/repo"
},
"revision": 15,
"tags": [],
"triggers": null,
"type": "build",
"uri": "vstfs:///Build/Definition/160",
"url": "https://account.visualstudio.com/guid/_apis/build/Definitions/160?revision=15",
"variableGroups": null,
"variables": {
"system.debug": {
"additionalProperties": {},
"allowOverride": true,
"isSecret": null,
"value": "false"
}
}
}
我们的 ionic 1 项目在 hooks 目录中有一堆奇怪的钩子脚本,我认为此时已经在 cordova 构建过程中实现了。清理我们的 hooks 目录,只保留必要的内容来解决这个问题。