Giter VIP home page Giter VIP logo

Comments (25)

hypervtechnics avatar hypervtechnics commented on June 16, 2024 4

Another cool way of handling this which works for me (does not start the daemon) is to add this line as a command line before all ionic builds:

Windows:
(if not exist "%USERPROFILE%/.gradle" mkdir "%USERPROFILE%/.gradle") && (echo. >> "%USERPROFILE%/.gradle/gradle.properties" && echo org.gradle.daemon=false >> "%USERPROFILE%/.gradle/gradle.properties")

Linux:
mkdir -p ~/.gradle && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties

Those disable the daemon by using a user wide configuration file. Taken from docs on Gradle Daemon. Thus this requires a fixed OS on the target system.

Finally I think this should be an accepted solution. Someone may put this as a more flexible script and/or specific for job.

EDIT on 17-09-2019:
Additional tip from @vitmantug regarding Gradle versions >= 5.0 because:

The default was changed from 1g to 512m in Gradle 5.0. Here in my example I'm setting the memory to 2GB (Xmx2g).

from vsts-cordova-tasks.

trevor-trou avatar trevor-trou commented on June 16, 2024 3

Maybe this will help someone. I had been using the Ionic Command with the parameters cordova build android --release to build my app. The app would always build fine, but the task simply wouldn't complete. Even when using an earlier version of Cordova.

I instead broke the single command into two. Now I run the Ionic Command with the parameters build (to prep the ionic assets) then follow that with the Cordova Build command. This seems to work for me, so long as I use Cordova 7.1.0 for the Cordova Build command.

from vsts-cordova-tasks.

dmittal02 avatar dmittal02 commented on June 16, 2024 1

I was actually using 7.1. to overcome this issue, we used daemon kill and then it worked. so still suspect, it it some bug\known issue.

from vsts-cordova-tasks.

SpartanVFL avatar SpartanVFL commented on June 16, 2024 1

Using 7.1 fixed that error for me as well

from vsts-cordova-tasks.

alexgermann avatar alexgermann commented on June 16, 2024 1

@trevor-trou I tried your fix but it didn't work! Do you have any other suggestions!?

from vsts-cordova-tasks.

bincos avatar bincos commented on June 16, 2024 1

Try to check one of this things:

  1. Make sure that your internet is not slower
  2. if you are running under a proxy/ please turn off your proxy may you antivirus is blocking the build processes (try disable your antivirus permanently)

this solved my case
.

from vsts-cordova-tasks.

dmittal02 avatar dmittal02 commented on June 16, 2024

Anyone on this.

from vsts-cordova-tasks.

drewgillies avatar drewgillies commented on June 16, 2024

Hi--it's possibly a known issue, although there is very little detail here. One workaround you could try is to include /p:instanceid=[instanceid] in the Arguments field for the Cordova build step, where [instanceid] is the code taken from the folder in %ProgramData%\Microsoft\VisualStudio\MDA which is relevant to your installation (if there is only one VS 2017 installed you should see only one). Hope this helps.

from vsts-cordova-tasks.

scott-hahn avatar scott-hahn commented on June 16, 2024

@dmittal02 You reported this issue a day after Cordova was upgraded to 8.0.0. You might try configuring your build task to use an older version ("7.1.0" for example), if possible. I've also had trouble building a simple (from the CLI - cordova create hello com.example.hello HelloWorld) using this same task with Cordova 8. I'm using the VSTS Hosted macOS build agents and getting the error:

TypeError: Cannot read property 'fail' of undefined
at /Users/vsts/.taco_home/node_modules/cordova/8.0.0/node_modules/cordova-lib/src/plugman/fetch.js:168:17
at _fulfilled (/Users/vsts/.taco_home/node_modules/cordova/8.0.0/node_modules/cordova-lib/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/Users/vsts/.taco_home/node_modules/cordova/8.0.0/node_modules/cordova-lib/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/Users/vsts/.taco_home/node_modules/cordova/8.0.0/node_modules/cordova-lib/node_modules/q/q.js:749:13)
at /Users/vsts/.taco_home/node_modules/cordova/8.0.0/node_modules/cordova-lib/node_modules/q/q.js:509:49
at flush (/Users/vsts/.taco_home/node_modules/cordova/8.0.0/node_modules/cordova-lib/node_modules/q/q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)

from vsts-cordova-tasks.

nmocruz avatar nmocruz commented on June 16, 2024

I'm getting this one to

from vsts-cordova-tasks.

av09 avatar av09 commented on June 16, 2024

I have faced the same issue I resolved it by creating taco.json in the project root, specifying "cordova-cli" version like below:

{
"cordova-cli": "8.0.0"
}
As specified in https://github.com/Microsoft/taco-team-build#general-settings point 1, I was building it for android.

from vsts-cordova-tasks.

sithwarrior avatar sithwarrior commented on June 16, 2024

@dmittal02 How did you do this?

we used daemon kill and then it worked

Im having the same issue, and using different cordova versions or createing the taco.json dosent work

from vsts-cordova-tasks.

tigrannajaryan avatar tigrannajaryan commented on June 16, 2024

Seems to be the same problem as #85

from vsts-cordova-tasks.

drewgillies avatar drewgillies commented on June 16, 2024

Visual Studio 2017 (and by extension MSBuild and vsts-cordova-tasks) supports Cordova v6.3.1 only. Are there any failures using this version of Cordova?

from vsts-cordova-tasks.

sithwarrior avatar sithwarrior commented on June 16, 2024

Hi Drew

If i set the cordova version to 6.3.1 i get the following error:

TypeError: cordovaProject.projectConfig.getFileResources is not a function at updateFileResources (D:\a\1\s\platforms\android\cordova\lib\prepare.js:416:46) at D:\a\1\s\platforms\android\cordova\lib\prepare.js:51:9 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) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9)

Is there a plan for getting support for higher versions of Cordova?
Cordova 6.3.1 is from Aug 2016.
Current version is 8.0.0

from vsts-cordova-tasks.

maerlynflagg avatar maerlynflagg commented on June 16, 2024

i have to use Cordova 7.1.0 or 8.0.0, because i have to support Android 8 and Android 8.1. Some customers update there devices to Android 8 and Android 8.1. my task is always support important current iOS and Android versions with my app.

so, Cordova 6.3.1 doesn't fit to the requirements. Cordova 6 only supports Android API 26. -> https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html

with Cordova 8 i get the an issue on remotebuild like the others: Cannot read property 'fail' of undefined.

currently Cordova 7.1.0 is working for Android API 27 and iOS, but if the next API only needs Cordova 8, i have a problem....

so @drewgillies
i think for some or morte people important, that VS2017/remotebuild get updates to work with current Cordova versions correctly.

in worst case, i need an alternative to "remotebuild" my app on a mac... :/

from vsts-cordova-tasks.

drewgillies avatar drewgillies commented on June 16, 2024

I understand the concern, but we are not implementing support for versions other than 6.3.1 at this stage. I can't comment further now. Given this hard blocker, if there are no other 6.3.1-related concerns I'll go ahead and close this issue. I know it's not the desired outcome.

from vsts-cordova-tasks.

sithwarrior avatar sithwarrior commented on June 16, 2024

Hi Drew. I really think that only supporting cordova 6.3.1 should be mentioned rather highly in all documentation, as it would be a showstopper for many.

from vsts-cordova-tasks.

enko avatar enko commented on June 16, 2024

@sithwarrior I got this error on my ionic app too, changing to cordova 6.4.0 fixed this issue.

from vsts-cordova-tasks.

kyriediculous avatar kyriediculous commented on June 16, 2024

Having this issue too.

Problem seems to solve itself when restarting Virtual device...

When using --verbose flag I'm getting

Running adb shell command "ps" on target emulator-5554...
Running command: C:\Users\N.vergauwen\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell ps
Command finished with error code 0: C:\Users\N.vergauwen\AppData\Local\Android\sdk\platform-tools\adb.exe -s,emulator-5554,shell,ps

from vsts-cordova-tasks.

hypervtechnics avatar hypervtechnics commented on June 16, 2024

I am experiencing the same. Adding --gradleArg=--no-daemon did nothing. Temporary did this by letting the build task continue on error and set the timeout to 15 minutes. The following copy to artifact staging will do the rest and some "error handling". Ofc this is only solution which should be used only once - during testing the pipeline...

from vsts-cordova-tasks.

penihel avatar penihel commented on June 16, 2024

Hi. I had the same problem.

I changed the "Agent pool" to "Hosted Ubuntu 1604" and worked.

from vsts-cordova-tasks.

sambowenhughes avatar sambowenhughes commented on June 16, 2024

Any update on this?

from vsts-cordova-tasks.

sithwarrior avatar sithwarrior commented on June 16, 2024

Any update on this?

As per the readme of the project. it seems to be deprecated/EOL.

As of March 2019, this repo is no longer maintained by Microsoft. If you're interested in continuing this project, please feel free to fork it. As of March 2019, we will no longer monitor or respond to open issues. Thanks for your support!

from vsts-cordova-tasks.

vitmantug avatar vitmantug commented on June 16, 2024

Another cool way of handling this which works for me (does not start the daemon) is to add this line as a command line before all ionic builds:

Windows:
(if not exist "%USERPROFILE%/.gradle" mkdir "%USERPROFILE%/.gradle") && (echo. >> "%USERPROFILE%/.gradle/gradle.properties" && echo org.gradle.daemon=false >> "%USERPROFILE%/.gradle/gradle.properties")

Linux:
mkdir -p ~/.gradle && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties

Those disable the daemon by using a user wide configuration file. Taken from docs on Gradle Daemon. Thus this requires a fixed OS on the target system.

Finally I think this should be an accepted solution. Someone may put this as a more flexible script and/or specific for job.

I totally agree that this should be an accepted solution. After trying many solutions, this was the one that worked.

But I should add that if you try this solution and then get memory problems, you need to adjust the memory used by gradle, like this:

(if not exist "%USERPROFILE%/.gradle" mkdir "%USERPROFILE%/.gradle") && (echo. >> "%USERPROFILE%/.gradle/gradle.properties" && (echo org.gradle.daemon=false && echo org.gradle.jvmargs=-Xmx2g) >> "%USERPROFILE%/.gradle/gradle.properties")

The default was changed from 1g to 512m in Gradle 5.0. Here in my example I'm setting the memory to 2GB (Xmx2g).

from vsts-cordova-tasks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.