Android、Azure Devops 在运行管道时出现错误##[错误]错误:进程“/Users/runner/work/1/s/gradlew”失败,退出代码为 1

发布于 2025-01-16 06:36:45 字数 603 浏览 3 评论 0原文

Android、Azure Devops 在运行管道时出现错误##[错误]错误:进程 '/Users/runner/work/1/s/gradlew' 失败,退出代码 1

在语言环境系统中生成所有工作 apk,但在 azure 运行管道时devops 它显示错误

FAILURE: Build failed with an exception.

* Where: Build file '/Users/runner/work/1/s/app/build.gradle' line: 2

* What went wrong: An exception occurred applying plugin request [id: 
'com.android.application']
 > Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.

我已经在使用 Java 11

我搜索了相同的内容但没有得到任何解决方案。

Android, Azure Devops geting error while run pipeline ##[error]Error: The process '/Users/runner/work/1/s/gradlew' failed with exit code 1

At locale system everything working apk generated but when run pipeline at azure devops it showing the error

FAILURE: Build failed with an exception.

* Where: Build file '/Users/runner/work/1/s/app/build.gradle' line: 2

* What went wrong: An exception occurred applying plugin request [id: 
'com.android.application']
 > Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.

I'm already using Java 11

I searched for same but not get any solution.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

兰花执着 2025-01-23 06:36:45

我已经通过在azure-pipelines.yml中添加maven任务解决了这个问题

steps:
  - task: Maven@3
    inputs:
      mavenPomFile: 'pom.xml'
      publishJUnitResults: false
      javaHomeOption: 'JDKVersion'
      jdkVersionOption: '1.11'
      mavenVersionOption: 'Default'
      mavenOptions: '-Xmx3072m'

希望这对其他人有帮助...

I have solved the issue by adding task for maven in azure-pipelines.yml

steps:
  - task: Maven@3
    inputs:
      mavenPomFile: 'pom.xml'
      publishJUnitResults: false
      javaHomeOption: 'JDKVersion'
      jdkVersionOption: '1.11'
      mavenVersionOption: 'Default'
      mavenOptions: '-Xmx3072m'

Hope this will helpful for other...

烟酒忠诚 2025-01-23 06:36:45

我有同样的问题,我解决了:

    - task: JavaToolInstaller@0
      inputs:
        versionSpec: '11'
        jdkArchitectureOption: 'x64'
        jdkSourceOption: 'PreInstalled'

I had a same issue and I solved it:

    - task: JavaToolInstaller@0
      inputs:
        versionSpec: '11'
        jdkArchitectureOption: 'x64'
        jdkSourceOption: 'PreInstalled'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文