Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 789
Rahul Mishra Avatar asked May 22 '26 01:05

Rahul Mishra


2 Answers

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

like image 106
Rahul Mishra Avatar answered May 23 '26 13:05

Rahul Mishra


I had a same issue and I solved it:

    - task: JavaToolInstaller@0
      inputs:
        versionSpec: '11'
        jdkArchitectureOption: 'x64'
        jdkSourceOption: 'PreInstalled'
like image 38
etczrn Avatar answered May 23 '26 14:05

etczrn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!