我试图在Azure devops中执行以下任务
- task: Gradle@3
displayName: 'Build Task'
continueOnError: false
inputs:
tasks: assembledevelopDebug -PversionCode=$(Build.BuildNumber) -PdisablePreDex --no-daemon
publishJUnitResults: false我得到了以下错误。有人能告诉我是否有什么不对的地方吗?我传递的是-PversionCode=$(Build.BuildNumber)的版本号。
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/runner/work/1/s/app/build.gradle' line: 15
* What went wrong:
A problem occurred evaluating project ':app'.
> For input string: "20220804.6"
Error: The process '/Users/runner/work/1/s/gradlew' failed with exit code 1
* Try:
at ExecState._setResult (/Users/runner/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.205.0/node_modules/azure-pipelines-task-lib/toolrunner.js:944:25)
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
at ExecState.CheckComplete (/Users/runner/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.205.0/node_modules/azure-pipelines-task-lib/toolrunner.js:927:18)
at ChildProcess.<anonymous> (/Users/runner/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.205.0/node_modules/azure-pipelines-task-lib/toolrunner.js:840:19)
* Get more help at https://help.gradle.org
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 23s
##[error]Code analysis failed. Gradle exit code: -1. Error: Error: The process '/Users/runner/work/1/s/gradlew' failed with exit code 1
Finishing: Build Task请注意,我在gitlab管道中也是这样做的,它不需要问题assembledevelopDebug -PversionCode=%CI_BUILD_ID% -PdisablePreDex -no daemon就可以工作。
发布于 2022-08-04 17:51:41
我理解了这一点;我只能为PversionCode传递整数值。将$(Build.BuildNumber)更改为$(Build.BuildId)将提供增量唯一整数并解决错误。
https://stackoverflow.com/questions/73236644
复制相似问题