I have an Android project which includes a JavaScript app. The JS app uses Yarn for package installation and running the build script. When building from the terminal with the Gradle Wrapper everything works fine. But when I try to build/run the project from IntelliJ/Android Studio all environment variables I have set for my account (including $PATH
) are reset. It seems like the Gradle runner in IntelliJ and Android Studio executes the build in an isolated shell. Since $PATH
is not properly set up, it doesn't find Yarn and Node to build the JavaScript app.
I've searched through all settings in IntelliJ and Android Studio and couldn't find anything related to environment configuration for Gradle. Did anyone else have this issue?
Opening up a terminal in IntelliJ itself and running Gradle from there works properly.
I'm working on macOS Sierra with IntelliJ 2017.3 and Android Studio 3.0.1. The only reason I'm using both is that after not working in Android Studio I thought it might run in IntelliJ.
It seemed to be a bug in Android Studio. I needed to set at least one environment variable in Android Studio itself and then it suddenly also picked up all existing env properties.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments