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

2

8

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.

Forging answered 23/3, 2022 at 8:4 Comment(2)
Does this answer your question? Android Studio Error "Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8"Cachalot
Thanks for your reply @DeepDave-MT, at android studio everything works fine but the issue is at Azure devops while run pipelineForging
F
8

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...

Forging answered 24/3, 2022 at 5:44 Comment(1)
Any idea how this solves the issue?Duala
C
2

I had a same issue and I solved it:

    - task: JavaToolInstaller@0
      inputs:
        versionSpec: '11'
        jdkArchitectureOption: 'x64'
        jdkSourceOption: 'PreInstalled'
Christophe answered 26/5, 2022 at 6:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.