0

I'm trying to create ci pipeline for react native project in azure devops, but this is the error I'm getting even after changing the version. I've tried many different methods but still could not able to succeed the pipeline. This is my log:

2022-10-07T11:04:59.5275117Z ##[section]Starting: gradlew buildRelease
2022-10-07T11:04:59.5409846Z ==============================================================================
2022-10-07T11:04:59.5410225Z Task         : Gradle
2022-10-07T11:04:59.5410472Z Description  : Build using a Gradle wrapper script
2022-10-07T11:04:59.5410737Z Version      : 3.208.0
2022-10-07T11:04:59.5410966Z Author       : Microsoft Corporation
2022-10-07T11:04:59.5411409Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/gradle
2022-10-07T11:04:59.5411795Z ==============================================================================
2022-10-07T11:05:00.1451082Z [command]C:\Windows\system32\cmd.exe /D /S /C "D:\a\1\s\android\gradlew.bat buildRelease"
2022-10-07T11:05:01.9432597Z Downloading https://services.gradle.org/distributions/gradle-7.4.2-all.zip
2022-10-07T11:05:07.0935534Z ...............10%...............20%...............30%...............40%...............50%................60%...............70%...............80%...............90%...............100%
2022-10-07T11:05:30.8525096Z 
2022-10-07T11:05:30.8526501Z Welcome to Gradle 7.4.2!
2022-10-07T11:05:30.8527032Z 
2022-10-07T11:05:30.8527522Z Here are the highlights of this release:
2022-10-07T11:05:30.8528014Z  - Aggregated test and JaCoCo reports
2022-10-07T11:05:30.8528562Z  - Marking additional test source directories as tests in IntelliJ
2022-10-07T11:05:30.8529103Z  - Support for Adoptium JDKs in Java toolchains
2022-10-07T11:05:30.8529408Z 
2022-10-07T11:05:30.8529880Z For more details see https://docs.gradle.org/7.4.2/release-notes.html
2022-10-07T11:05:30.8530210Z 
2022-10-07T11:05:31.1680632Z Starting a Gradle Daemon (subsequent builds will be faster)
2022-10-07T11:08:29.5934911Z > Task :react-native-gradle-plugin:compileKotlin
2022-10-07T11:08:35.9342383Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (10, 37): 'BaseVariant' is deprecated. Deprecated in Java
2022-10-07T11:08:35.9350573Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (119, 30): 'BaseVariant' is deprecated. Deprecated in Java
2022-10-07T11:08:35.9354434Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (135, 26): 'BaseVariant' is deprecated. Deprecated in Java
2022-10-07T11:08:35.9362798Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (155, 32): 'BaseVariant' is deprecated. Deprecated in Java
2022-10-07T11:08:35.9364165Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (161, 31): 'BaseVariant' is deprecated. Deprecated in Java
2022-10-07T11:08:35.9368312Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactExtension.kt: (169, 36): 'BaseVariant' is deprecated. Deprecated in Java
2022-10-07T11:08:35.9369753Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\ReactPlugin.kt: (100, 48): 'reactRoot: DirectoryProperty' is deprecated. reactRoot was confusing and has been replace with rootto point to your root project and reactNativeDir to point to the folder of the react-native NPM package
2022-10-07T11:08:35.9374781Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (10, 37): 'ApplicationVariant' is deprecated. Deprecated in Java
2022-10-07T11:08:35.9375845Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (11, 37): 'BaseVariant' is deprecated. Deprecated in Java
2022-10-07T11:08:35.9376846Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (12, 37): 'LibraryVariant' is deprecated. Deprecated in Java
2022-10-07T11:08:35.9377820Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (28, 51): 'BaseVariant' is deprecated. Deprecated in Java
2022-10-07T11:08:35.9380885Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (131, 12): 'ApplicationVariant' is deprecated. Deprecated in Java
2022-10-07T11:08:35.9382001Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (132, 12): 'LibraryVariant' is deprecated. Deprecated in Java
2022-10-07T11:08:35.9382989Z w: D:\a\1\s\node_modules\react-native-gradle-plugin\src\main\kotlin\com\facebook\react\TaskConfiguration.kt: (252, 14): 'BaseVariant' is deprecated. Deprecated in Java
2022-10-07T11:08:40.3447209Z 
2022-10-07T11:08:40.3449144Z > Task :react-native-gradle-plugin:compileJava FAILED
2022-10-07T11:08:40.4615200Z 
2022-10-07T11:08:40.4699689Z FAILURE: Build failed with an exception.
2022-10-07T11:08:40.4701519Z 
2022-10-07T11:08:40.4702221Z * What went wrong:
2022-10-07T11:08:40.4702853Z Execution failed for task ':react-native-gradle-plugin:compileJava'.
2022-10-07T11:08:40.4703478Z > invalid source release: 11
2022-10-07T11:08:40.4703757Z 
2022-10-07T11:08:40.4707391Z * Try:
2022-10-07T11:08:40.4708589Z > Run with --stacktrace option to get the stack trace.
2022-10-07T11:08:40.4709552Z > Run with --info or --debug option to get more log output.
2022-10-07T11:08:40.4710441Z > Run with --scan to get full insights.
2022-10-07T11:08:40.4710964Z 
2022-10-07T11:08:40.4711696Z * Get more help at https://help.gradle.org
2022-10-07T11:08:40.4712142Z 
2022-10-07T11:08:40.4712783Z BUILD FAILED in 3m 39s
2022-10-07T11:08:40.4713539Z 2 actionable tasks: 2 executed
2022-10-07T11:08:41.1438085Z Error: The process 'D:\a\1\s\android\gradlew.bat' failed with exit code 1
2022-10-07T11:08:41.1439977Z     at ExecState._setResult (D:\a\_tasks\Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4\3.208.0\node_modules\azure-pipelines-task-lib\toolrunner.js:944:25)
2022-10-07T11:08:41.1441704Z     at ExecState.CheckComplete (D:\a\_tasks\Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4\3.208.0\node_modules\azure-pipelines-task-lib\toolrunner.js:927:18)
2022-10-07T11:08:41.1443613Z     at ChildProcess.<anonymous> (D:\a\_tasks\Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4\3.208.0\node_modules\azure-pipelines-task-lib\toolrunner.js:840:19)
2022-10-07T11:08:41.1445133Z     at ChildProcess.emit (events.js:198:13)
2022-10-07T11:08:41.1446346Z     at maybeClose (internal/child_process.js:982:16)
2022-10-07T11:08:41.1447621Z     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
2022-10-07T11:08:41.1503702Z ##[error]Code analysis failed. Gradle exit code: -1. Error: Error: The process 'D:\a\1\s\android\gradlew.bat' failed with exit code 1
2022-10-07T11:08:41.1577154Z ##[section]Finishing: gradlew buildRelease

enter link description here enter image description here

Varun
  • 11
  • 2
  • Please post your build.gradle files -- project and module level. – Jay Oct 07 '22 at 12:52
  • I've uploaded the build.gradle file – Varun Oct 07 '22 at 13:40
  • You may have to specify the Java version for building this project. Make sure that your Azure agent is using Java 11 by default to compile a project. If it is not, you will have to configure and use the [JavaToolInstaller task](https://stackoverflow.com/a/58446436/5990846) in your pipeline before your start the `Gradle` task. You may also need to specify `java { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 }` in your app level build.gradle file. – Jay Oct 07 '22 at 14:02

0 Answers0