$PATH not set properly when running Gradle from IntelliJ/Android Studio

Mato

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.

Mato

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

What does it mean to to set path to jdk8 when running gradle 6,7,8?

From Dev

"Could not normalize path for file" when running gradle check

From Dev

How to set NDK_MODULE_PATH in Android Studio and/or gradle?

From Dev

"Warning! PATH is not properly set up" when using RVM with virtualenv

From Dev

zsh PATH variable not properly set from another environment variable

From Dev

(Gradle) ClassNotFoundException when running testNG test task for new source set

From Dev

(Gradle) ClassNotFoundException when running testNG test task for new source set

From Dev

Editing AndroidManifest.xml in Gradle task processManifest.doLast has no effect when running app from Android Studio

From Dev

Winform TopMost Property not working properly when instance is running from Sever

From Dev

How get the current running Visual Studio installation path from VSPackage

From Dev

Django static path is not properly set

From Dev

Run 'uninstallAll' gradle task before running application in Android Studio from build.gradle

From Java

Getting "Warning! PATH is not properly set up" when doing rvm use 2.0.0 --default

From Dev

Gradle downloads to ?/.gradle directory when running tasks

From Dev

STARTUPINFO.wShowWindow is 0 when running from Visual Studio

From Dev

"No extensions found" when running Visual Studio Code from source

From Dev

HOME not set when running bash from rc.local

From Dev

How to use all CPU cores/threads when running Android Studio gradle build?

From Dev

Set PATH when launching a new terminal from a script in Mac

From Dev

RVM - Warning! PATH is not properly set up

From Dev

Karate - how to set path to driver properly (executable)

From Dev

Karate - how to set path to driver properly (executable)

From Dev

Android Studio: Gradle Build Running for 3 minutes

From Dev

Android Studio 2.3.3 stuck on Gradle Build Running

From Dev

android studio - gradle manifest file path

From Dev

NullPointerException from gradle when running react-native run-android

From Dev

Spring Boot incorrectly loads test configuration when running from eclipse+gradle

From Dev

Visual Studio not deploying when running

From Dev

Not able to reflect the setting of auto_path in TCL when running from another machine

Related Related

  1. 1

    What does it mean to to set path to jdk8 when running gradle 6,7,8?

  2. 2

    "Could not normalize path for file" when running gradle check

  3. 3

    How to set NDK_MODULE_PATH in Android Studio and/or gradle?

  4. 4

    "Warning! PATH is not properly set up" when using RVM with virtualenv

  5. 5

    zsh PATH variable not properly set from another environment variable

  6. 6

    (Gradle) ClassNotFoundException when running testNG test task for new source set

  7. 7

    (Gradle) ClassNotFoundException when running testNG test task for new source set

  8. 8

    Editing AndroidManifest.xml in Gradle task processManifest.doLast has no effect when running app from Android Studio

  9. 9

    Winform TopMost Property not working properly when instance is running from Sever

  10. 10

    How get the current running Visual Studio installation path from VSPackage

  11. 11

    Django static path is not properly set

  12. 12

    Run 'uninstallAll' gradle task before running application in Android Studio from build.gradle

  13. 13

    Getting "Warning! PATH is not properly set up" when doing rvm use 2.0.0 --default

  14. 14

    Gradle downloads to ?/.gradle directory when running tasks

  15. 15

    STARTUPINFO.wShowWindow is 0 when running from Visual Studio

  16. 16

    "No extensions found" when running Visual Studio Code from source

  17. 17

    HOME not set when running bash from rc.local

  18. 18

    How to use all CPU cores/threads when running Android Studio gradle build?

  19. 19

    Set PATH when launching a new terminal from a script in Mac

  20. 20

    RVM - Warning! PATH is not properly set up

  21. 21

    Karate - how to set path to driver properly (executable)

  22. 22

    Karate - how to set path to driver properly (executable)

  23. 23

    Android Studio: Gradle Build Running for 3 minutes

  24. 24

    Android Studio 2.3.3 stuck on Gradle Build Running

  25. 25

    android studio - gradle manifest file path

  26. 26

    NullPointerException from gradle when running react-native run-android

  27. 27

    Spring Boot incorrectly loads test configuration when running from eclipse+gradle

  28. 28

    Visual Studio not deploying when running

  29. 29

    Not able to reflect the setting of auto_path in TCL when running from another machine

HotTag

Archive