can't access --dart-define arguments in dart code when run native project in root/android folder with Android Studio #61713
Labels
found in release: 1.21
Found to occur in 1.21
has reproducible steps
The issue has been confirmed reproducible and is ready to work on
platform-android
Android applications specifically
tool
Affects the "flutter" command-line tool. See also t: labels.
I have read this article that about --dart-define
Flutter 1.17 — no more Flavors, no more iOS Schemas. Command argument that changes everything
I notice that after running
flutter run --dart-define=ENV=QA
to launch app on iOS device by Command-Line, in iOS folder a Generated.xcconfig will be generated in xcode project, so next time I can debug app with xcode directly the app can get ENV value through Generated.xcconfig in dart code.like:
static const appEnv = String.fromEnvironment('ENV', '');
But after running
flutter run --dart-define=ENV=QA
to launch app on android device by Command-Line, then use Android Studio to open the native project in android root/folder, debug app directly, the app still can't get ENV value, is there any way that let me can debug android app and pass dart-define into app? without vscode or commond-line because I need to debug native code with Android Studio but the command argument is required in dart code.The text was updated successfully, but these errors were encountered: