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

Environment variables option field is disabled #6746

Closed
John-Dormevil opened this issue May 10, 2023 · 6 comments · Fixed by #6765
Closed

Environment variables option field is disabled #6746

John-Dormevil opened this issue May 10, 2023 · 6 comments · Fixed by #6765
Milestone

Comments

@John-Dormevil
Copy link

John-Dormevil commented May 10, 2023

Steps to Reproduce

Hi I'm trying to set some environment variables through optional fields in run configuration, the issue is the field is disabled why ?
image

Version info

IntelliJ IDEA 2023.1.1 (Ultimate Edition)
Build #IU-231.8770.65, built on April 27, 2023

flutter doctor:

[✓] Flutter (Channel stable, 3.7.12, on macOS 13.2.1 22D68 darwin-arm64, locale fr-FR)
• Flutter version 3.7.12 on channel stable at /Users/dormeviljean-jules/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4d9e56e694 (3 weeks ago), 2023-04-17 21:47:46 -0400
• Engine revision 1a65d409c7
• Dart version 2.19.6
• DevTools version 2.20.1
• Pub download mirror https://artifactory.dt.renault.com/artifactory/api/pub/pub-mym-irn75511

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at /Users/dormeviljean-jules/Library/Android/sdk
• Platform android-33, build-tools 33.0.2
• Java binary at: /Users/dormeviljean-jules/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.9971841/Android
Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E222b
• CocoaPods version 1.12.0

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
• Android Studio at /Users/dormeviljean-jules/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9619390/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[✓] Android Studio (version 2022.2)
• Android Studio at /Users/dormeviljean-jules/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.9971841/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.1)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.1)
• IntelliJ at /Users/dormeviljean-jules/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
• Flutter plugin version 73.0.4
• Dart plugin version 231.8770.15

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.1)
• IntelliJ at /Users/dormeviljean-jules/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/231.8770.65/IntelliJ IDEA.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] IntelliJ IDEA Ultimate Edition (version 2022.3.3)
• IntelliJ at /Users/dormeviljean-jules/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/223.8836.41/IntelliJ IDEA.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.77.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.62.0

[✓] Connected device (3 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 13 (API 33) (emulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.2.1 22D68 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 112.0.5615.137

[✓] HTTP Host Availability
• All required HTTP hosts are available

• No issues found!

@stevemessick
Copy link
Member

Your run config is named "MyDuo Mobile". Is that for a mobile device? Environment variables are only useful when running a desktop app.

@stevemessick stevemessick added the waiting for customer response Auto-close if no response label May 10, 2023
@John-Dormevil
Copy link
Author

Hi ^^
Yes it's a mobile app, but for build phase like fetching package from artifactory, I need to specify some environment variable like PUB_HOSTED_URL

@github-actions github-actions bot removed the waiting for customer response Auto-close if no response label May 10, 2023
@stevemessick
Copy link
Member

You'll need to build from the command line, or specify the environment variables in your login shell script (which will require rebooting).

@John-Dormevil
Copy link
Author

John-Dormevil commented May 10, 2023

Actually I use https://direnv.net/ from the command line to launch the app. But I loose all the capability of my IDE. The variables of my directory is not load when I launch the app from intellij idea.

@stevemessick
Copy link
Member

I was just looking through the code, and I think we have a little bit-rot. It looks like envars are not enabled for anything anymore.

I have two suggestions you can try.

  • flutter config --enable-macos-desktop on the command line, then restart the IDE and see if the envar field is enabled
  • If that doesn't work, add the envar definitions to your shell start-up script that runs at login, then reboot your Mac (I know, not ideal, but it will work)

Let us know if that helps.

@stevemessick stevemessick added the waiting for customer response Auto-close if no response label May 10, 2023
@stevemessick stevemessick added this to the M74 milestone May 10, 2023
@John-Dormevil
Copy link
Author

John-Dormevil commented May 11, 2023

Thanks flutter config --enable-macos-desktop allow me to add variables in the run configuration. I don't prefer to add the variables globally because it's specific to a project (directory).

@github-actions github-actions bot removed the waiting for customer response Auto-close if no response label May 11, 2023
stevemessick added a commit that referenced this issue May 25, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Fixes #6746
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.

2 participants