Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

VSTS build error using Cordova version 6.5.0 #71

Closed
tcihak-fqa opened this issue May 31, 2017 · 5 comments
Closed

VSTS build error using Cordova version 6.5.0 #71

tcihak-fqa opened this issue May 31, 2017 · 5 comments

Comments

@tcihak-fqa
Copy link

Using the Cordova Build task in VSTS and setting the Cordova Version to 6.5.0.
The Cordova build now requires gradle to be installed.

Here's the error:
{ CordovaError: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
at Object.module.exports.check_gradle (d:\a\1\s\platforms\android\cordova\lib\check_reqs.js:146:18)
at GradleBuilder.prepEnv (d:\a\1\s\platforms\android\cordova\lib\builders\GradleBuilder.js:176:23)
at Api.module.exports.run (d:\a\1\s\platforms\android\cordova\lib\build.js:152:20)
at d:\a\1\s\platforms\android\cordova\Api.js:348:43
at _fulfilled (d:\a\1\s\platforms\android\cordova\node_modules\q\q.js:854:54)
at self.promiseDispatch.done (d:\a\1\s\platforms\android\cordova\node_modules\q\q.js:883:30)
at Promise.promise.promiseDispatch (d:\a\1\s\platforms\android\cordova\node_modules\q\q.js:816:13)
at d:\a\1\s\platforms\android\cordova\node_modules\q\q.js:624:44
at runSingle (d:\a\1\s\platforms\android\cordova\node_modules\q\q.js:137:13)
at flush (d:\a\1\s\platforms\android\cordova\node_modules\q\q.js:125:13)
name: 'CordovaError',
message: 'Could not find an installed version of Gradle either in Android Studio,\nor on your system to install the gradle wrapper. Please include gradle \nin your path, or install Android Studio',

@dpetrishin
Copy link

@tcihak-fqa Hi, what kind of OS do you use?

@tcihak-fqa
Copy link
Author

This is on the VSTS Hosted agent, so it's Windows Server 2012 R2.

@dpetrishin
Copy link

@tcihak-fqa Ok, thanks for information.

That bug appears because of update of android sdk tools. So cordova refers on folder which is not exists in new android sdk tools versions now. While cordova is fixing that bug I can offer you temporary solution.

Early that bug was fixed by installing of Android Studio in Windows. But it's not helped in MacOS.
So you could try to install Android Studio and see what happens or do steps, described below.

Please, follow my instructions.

  1. Download older version of android sdk tools.
  2. Go to :\Users\%User%\AppData\Local\Android\sdk
  3. Make a backup of tools folder.
  4. Replace tools folder with downloaded one.

Hope, this will help.

@tcihak-fqa
Copy link
Author

Here's what I am doing in my VSO build definition:

  1. Downloading Gradle 3.3 bin using the Powershell task
  2. Extracting Gradle to the workspace
  3. Creating a batch script to pre-pend the gradle path (.\gradle-3.3\bin) to the "path" environment variable (append didn't work because the path is too long?)
  4. Running the batch script using the Batch Script task (with Modify Environment checked)
  5. Building my using Cordova

@cocowalla
Copy link

cocowalla commented Aug 25, 2017

@tcihak-fqa do those steps work for you? If so, would you be able to create a gist with your scripts?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants