[Solved]-"error obtaining vcs status: exit status 128 use -buildvcs=false to disable vcs stamping."


Error: Error obtaining VCS status - Exit status 128

If you encounter the error "error obtaining VCS status: exit status 128," it indicates a problem with obtaining version control information during the build process. The message also suggests using the `-buildvcs=false` flag to disable VCS stamping. Here's how you can resolve it:

  1. Disable VCS Stamping: As suggested in the error message, you can use the `-buildvcs=false` flag to disable VCS stamping during the build process. This can be done depending on the build tool you are using.
# For example, in a Maven build, you can disable VCS stamping like this
mvn clean install -Dbuildvcs=false
  1. Check Version Control System: Ensure that your project is properly configured with the correct Version Control System (Git, SVN, etc.). Check if your VCS is initialized and the repository is in a good state.
# Verify if your Git repository is initialized and in a good state
git status
  1. Update Dependencies: Ensure that you have the latest version of your build tool and related dependencies. Sometimes, updating to the latest versions can resolve compatibility issues.
# For Maven, you can update your dependencies
mvn clean install -U

After making these adjustments, try building your project again. Disabling VCS stamping should allow you to proceed with the build without obtaining VCS status.

By executing the command:

git config --global --add safe.directory [your dir here]

You can eliminate the VCS (Version Control System) stamping warning.