Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Build Failed' when launching app, needs more explanation #358

Closed
kdvolder opened this issue Aug 9, 2018 · 10 comments · Fixed by #684
Closed

'Build Failed' when launching app, needs more explanation #358

kdvolder opened this issue Aug 9, 2018 · 10 comments · Fixed by #684
Milestone

Comments

@kdvolder
Copy link

kdvolder commented Aug 9, 2018

It happens occasionally that when I (try to) launch and app by pressing F5, I am greeted with a dialog to the effect that 'Build Failed'. My project looks fine as far as I can tell. There is really no way for me to know what this 'mysterious build' is not happy about. That is a very poor user experience. At least there should be some way to see the root error from this 'build' that was silently run on my behalf, without generating any output whatsoever in any place that I can read it.

Note: having some inkling that the error probably comes from the JDT language server, and having some experience with JDT + m2e in a 'real' Eclipse, I am guessing the problem may be that m2e thinks the 'project model is out of date with the pom'. (This is a common and annoying error we often see as m2e users). Typically you can make it go away by urging m2e to force a project update. So... what I do in vscode, is open up the pom, type some whitespace, and save. Then JDT LS extension will offer to do just that, rebuild project models. Lo and behold... this usually fixes the problem and makes that annoying error go away next time I try to launch.

To be honest, maybe this mess, isn't the fault of the vscode-java-debug plugin (but rather something that maybe jdt.ls should handle better). However, I think it would still be a good idea to add some more information to that annoying dialog (which I presume) vscode-java-debug is popping up.

This, 'the build has failed' dialog is truly infuriating. You are telling me there was an error, but you don't bother telling me what the error actually was? Really?

@yaohaizh
Copy link
Contributor

yaohaizh commented Aug 10, 2018

@kdvolder I have logged related issue to vscode repo. You can follow or input more information in that issue. Thanks.

@hawkerm
Copy link

hawkerm commented Oct 15, 2018

I just got a build failed issue too. I had to clear the cache, it'd be nice if the build failed option had that as an option or did that as step if there are no error class problems.

It looks like I got in this state from opening a .java file in VS Code from outside of my Java Project.

@elisetreit
Copy link

I have also been having this problem, but if I click proceed it works approximately 30% of the time. I have cleared the workspace cache, and while it worked this first time to stop having this error, it doesn't work anymore.

@JamesBewley
Copy link

JamesBewley commented Oct 18, 2018

I'm just configuring VS code to run as a debugger and have an exiting ant build process that works fine.

The debugger is working fine now and I have a preLaunchTask to build the ant target but I still have to see the "Build failed, do you want to continue?" and click "Proceed" before the debugger will lanuch.

What exactly is the plugin trying to do?
Can it be disabled (the follow have no effect)?
"java.autobuild.enabled": false, "java.completion.enabled": false,

@andxu
Copy link
Contributor

andxu commented Oct 18, 2018

@JamesBewley disabling auto build is exactly the same operation of disabling the build automatically menu, but before launching debug we will force a build since we don't want you to run on out-dated project, if you want to disable the whole build and use custom build in prelaunch task, there is no-way by now, we can have the option/solution in future:
image

@JamesBewley
Copy link

@andxu yes, shall I raise a new ticket for this bug/feature?

What would be the alternative? Would I need to switching the build process to use maven?

@andxu
Copy link
Contributor

andxu commented Oct 19, 2018

yes, I suggest to move on maven for the workaround.

@aleyan
Copy link

aleyan commented May 22, 2019

Has there been any changes on this lately?

I get "Build failed: do you want to continue?" dialog every single time I launch the debugger with "Proceed" working 100% of the time. Reiterating kdvolder:

There is really no way for me to know what this 'mysterious build' is not happy about. That is a very poor user experience.

Not a big deal because it works, but it is really annoying not being able to find out what this build failure is about.

@clankill3r
Copy link

Same issue.
What is a good way to clear the cache?

@testforstephen
Copy link
Contributor

testforstephen commented Oct 11, 2019

Here is the improvement for this error:

  1. If there are errors found in the PROBLEMS view, will open PROBLEMS view directly.
  2. Provide more fix suggestions.
    image
  3. Click Fix.., list four fix suggestions.
    image

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

Successfully merging a pull request may close this issue.

9 participants