Search code examples
androidcordovagradleazure-devopsazure-devops-hosted-agent

Cordova build android error: Could not resolve com.github.scottyab:rootbeer:0.0.7 on vs 2017 azure devops agent


​Hi,

On azure devops vs2017 agent, since 26th september 2019, my cordova build android command in the build pipeline is failing with error

Task :app:preReleaseBuild FAILED Task :CordovaLib:generateReleaseRFile

10 actionable tasks: 10 executed FAILURE: Build failed with an exception.

  • What went wrong: Could not resolve all files for configuration ':app:releaseCompileClasspath'.

    Could not resolve com.github.scottyab:rootbeer:0.0.7. Required by: project :app Skipped due to earlier error

  • Try: 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.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2m 26s { Error: d:\a\1\s\p\src\phone\platforms\android\gradlew: Command failed with exit code 1 Error output: Removing ant.properties update hook FAILURE: Build failed with an exception.

  • What went wrong: Could not resolve all files for configuration ':app:releaseCompileClasspath'.

    Could not resolve com.github.scottyab:rootbeer:0.0.7. Required by: project :app Skipped due to earlier error

  • Try: 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.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2m 26s at ChildProcess.whenDone (d:\a\1\s\p\src\phone\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:135:23) at ChildProcess.emit (events.js:198:13) at ChildProcess.cp.emit (d:\a\1\s\p\src\phone\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (internal/child_process.js:982:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)

The latest version uses gradle 5.6.2 but my last successful build used gradle 5.6. I even uninstalled gradle 5.6.2 from build agent and installed 5.6 using chocolatey task but its still failing with the same error. Not sure what else has changed on the build agent. Code is the same. Anyone has seen a similar issue?


Solution

  • Temporary workaround was to remove cordova-plugin-iroot plugin which was using rootbeer packages. This did resolve the build errors. We still need to find a permanent solution for this or unless cordova upgrades their azure devops tasks version and uses an updated version of gradle. currently its using gradle 4.10.3