Closed Hadatko closed 4 years ago
Hi @Hadatko and thanks for your reporting. As seen from your logs there may be two different ANDROID_HOME
system variable definitions in ~/.bashrc
and ~/.bash_profile
. VS Code editor launched from UI requires system variables to be defined in ~/.bash_profile
. Please make sure that your ~/.bash_profile
file contains correct environment variables.
Hi @RedMickey, unfortunatelly i don't have .bash_profile at all.
It looks like newer OS doesn't have .bash_profile file. Are you parsing this file? Is it wise? Shouldn't you read system environment variables from system itself?
e.g.: If you can run shell command, you can run this: printenv
@Hadatko, the extension doesn't parse any environment variables itself. It uses the environment variables that VS Code editor provides to it.
If there isn't ~/.bash_profile
file in your system, please make sure that ~/.profile
file refers to ~/.bashrc
and ~/.bashrc
contains all the environment settings.
~/.profile
should contain something like this to forward all settings from ~/.bashrc
:
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
Please add the code above to ~/.profile
file if there isn't.
nano ~/.profile
source ~/.profile
Also you can start VS Code from system terminal by using code
command. So the editor will take variables from ~/.bashrc
file.
Could you please try these suggestions and let us know about your results?
I am always running code from cmd. But i need to tell that today it is working. Maybe restart system helped (i don't know how. I restarted app several times with new terminal with actual enviroment as described above.). I also don't have .profile file. But it started work so i am fine. Thank you for your time and help ;)
Sounds good! Please feel free to open new ones if needed.
@RedMickey I am using zsh isntead of bash and I have the same issue. What should I do in my case?
Hi @Windstalker, I tried to use zsh
instead of bash
and didn't face any problems. I configured zsh
the following way:
zsh
and set it as default~/.zshrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
source ~/.zshrc
in terminalAfter that VS Code should also use zsh
as default terminal.
Actual Behavior
Expected Behavior
Software versions
Outputs (Include if relevant)
FAILURE: Build failed with an exception.
Where: Script '/home/kuhadatko/kseftiky/daq-ozm/daq-ozm/gui/android/platforms/android/CordovaLib/cordova.gradle' line: 68
What went wrong: A problem occurred evaluating project ':app'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s Command finished with error code 1: /home/kuhadatko/kseftiky/daq-ozm/daq-ozm/gui/android/platforms/android/gradlew cdvBuildDebug,-b,/home/kuhadatko/kseftiky/daq-ozm/daq-ozm/gui/android/platforms/android/build.gradle /home/kuhadatko/kseftiky/daq-ozm/daq-ozm/gui/android/platforms/android/gradlew: Command failed with exit code 1 Error output: Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
Where: Script '/home/kuhadatko/kseftiky/daq-ozm/daq-ozm/gui/android/platforms/android/CordovaLib/cordova.gradle' line: 68
What went wrong: A problem occurred evaluating project ':app'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s Error: /home/kuhadatko/kseftiky/daq-ozm/daq-ozm/gui/android/platforms/android/gradlew: Command failed with exit code 1 Error output: Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
Where: Script '/home/kuhadatko/kseftiky/daq-ozm/daq-ozm/gui/android/platforms/android/CordovaLib/cordova.gradle' line: 68
What went wrong: A problem occurred evaluating project ':app'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s at ChildProcess.whenDone (/home/kuhadatko/kseftiky/daq-ozm/daq-ozm/gui/android/node_modules/cordova-common/src/superspawn.js:135:23) at ChildProcess.emit (events.js:193:13) at maybeClose (internal/child_process.js:999:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:266:5) 'cordova run android --device --verbose --no-update-notifier' failed with exit code 1
kuhadatko@kuhadatko-GL552VW:~/kseftiky/daq-ozm/daq-ozm/gui/android$ echo ${ANDROID_SDK_ROOT} /home/kuhadatko/Android/Sdk kuhadatko@kuhadatko-GL552VW:~/kseftiky/daq-ozm/daq-ozm/gui/android$ echo ${ANDROID_HOME} /home/kuhadatko/Android/Sdk