microsoft / vsts-cordova-tasks

Streamline CI setup for your Apache Cordova, PhoneGap, Ionic, or Cordova CLI compatible app using a set of useful pre-defined build steps for VS Team Services or TFS
http://go.microsoft.com/fwlink/?LinkID=691188
Other
25 stars 27 forks source link

Ionic Command cordova build android runs forever #85

Closed knnithyanand closed 6 years ago

knnithyanand commented 6 years ago

I am using the Ionic Command task with cordova build android as argument, in my logs I notice that the build was successful and has even generated the apk file however the task does not complete.

My simple ionic app only has the following tasks:

  1. npm install
  2. Ionic Command cordova build android

Below is the last few lines of my log:

2018-03-10T07:42:33.4634086Z BUILD SUCCESSFUL in 3m 9s 2018-03-10T07:42:33.4634247Z 49 actionable tasks: 49 executed 2018-03-10T07:42:34.1416259Z Built the following apk(s): 2018-03-10T07:42:34.1416710Z D:\a\1\s\platforms\android\app\build\outputs\apk\debug\app-debug.apk 2018-03-10T07:50:10.0281984Z ##[error]The operation was canceled. 2018-03-10T07:50:10.0323295Z ##[section]Finishing: Ionic Command cordova build android

Here is my full logs: logs_182.zip

kaskeloten commented 6 years ago

Also having this problem.

dahlbyk commented 6 years ago

I just ran into this, too. In my case, it seems related to the Gradle daemon, despite --gradleArg=--no-daemon?

2018-04-12T07:22:12.5433965Z Queueing build for platform android w/options: --debug,--device,--gradleArg=--no-daemon 2018-04-12T07:22:12.6075190Z Processing res/native for android 2018-04-12T07:22:25.0264273Z ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk 2018-04-12T07:22:25.0264688Z JAVA_HOME=C:\Program Files\Java\jdk1.8.0_162 2018-04-12T07:22:35.7706810Z Starting a Gradle Daemon (subsequent builds will be faster)

p1p3 commented 6 years ago

Also having this problem.

sithwarrior commented 6 years ago

Im having the exact same problem.

Cordova 7.1.0 Cordova Android 6.4.0

Also tested with Cordova Android 6.3.0

tigrannajaryan commented 6 years ago

I have the exact same problem. The ionic build finishes successfully and gets stuck at the end. The log shows that grade daemon is started. It appears that there must be a fix for this but it does not work: https://github.com/Microsoft/vsts-cordova-tasks/blob/2249ced3ee44b8eeda9faef20bdb09fd8b05774c/Tasks/CordovaBuild/lib/cordova-task.js#L203

tigrannajaryan commented 6 years ago

Seems to be the same issue as https://github.com/Microsoft/vsts-cordova-tasks/issues/82

dahlbyk commented 6 years ago

For what it's worth, my build started working by switching to a macOS agent; only Windows hangs with the Gradle daemon. Oddly, the Gradle Daemon seems like it's still starting on macOS:

2018-05-07T14:22:16.9812730Z Queueing build for platform android w/options: --debug,--device,--gradleArg=--no-daemon
2018-05-07T14:22:17.1492620Z Processing res/native for android
2018-05-07T14:22:18.1304590Z ANDROID_HOME=/Users/vsts/Library/Android/sdk
2018-05-07T14:22:18.1320120Z JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home
2018-05-07T14:22:19.2554410Z Starting a Gradle Daemon (subsequent builds will be faster)
2018-05-07T14:22:22.8006720Z Gradle 4.7

Update: Or maybe the build is succeeding but not actually working? Still exploring...

drewgillies commented 6 years ago

I'm going to close this as it's a dupe of https://github.com/Microsoft/vsts-cordova-tasks/issues/82 - I'm discussing closing it with others there, but you may want to get on the conversation.