我尝试在Android Studio的flutter项目中将环境变量添加到运行/调试配置中,但该字段显示为灰色,而且我不知道如何创建环境变量。您知道如何以这种方式或其他方式添加环境变量吗?
A picture of my Run/Debug cConfigurations where the Environment variables are greyed out
我尝试在Android Studio的flutter项目中将环境变量添加到运行/调试配置中,但该字段显示为灰色,而且我不知道如何创建环境变量。您知道如何以这种方式或其他方式添加环境变量吗?
A picture of my Run/Debug cConfigurations where the Environment variables are greyed out
1条答案
按热度按时间fcwjkofz1#
不建议使用的方法是编辑
flutter
文件(脚本文件:Unix:bash,Windows:bat). see here的文件夹我使用的是linux,我遇到了一个应用程序规模的问题(因为我使用的是hidpi屏幕),解决这个问题最简单的方法可能是设置环境变量
GDK_SCALE=2
。经过一番努力,我最终编辑了flutter源文件,如下所示:如果你想在开始一个新项目时改变环境变量,请考虑
RUN confiugration
中的before launch
选项,你可以在运行当前配置之前运行其他配置。理想的运行顺序是运行delete environment variable lines
配置(Shell脚本类型),在此之前执行(发布前)flutter run
配置,之前执行(发布前)add environment variable lines
配置(Shell脚本类型)。(共3个按顺序链接的配置文件)它还应显示flutter调试窗口,因为此选项存在于flutter run
配置中。我尝试过的其他方法:
1.设置全局环境(所有应用程序规模均已更改)
1.修改Android Studio桌面文件(Android Studio大小已更改)
1.破解android studio运行配置(如$(export x=1)以执行命令,但失败)