flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.97k stars 316 forks source link

Running web app from Android Studio is not preserving the last build session #7589

Open vinay-skycliff-it opened 1 month ago

vinay-skycliff-it commented 1 month ago

Launch Config for VS Code:

{
            "name": "Flutter-web",
            "request": "launch",
            "type": "dart",
            "program": "lib/main.dart",
            "args": [
                "-d",
                "chrome",
                "--web-port",
                "55586",
                "--web-browser-flag=--disable-web-security"
            ]
        },

Launch Config for Android Studio:

  <configuration default="false" name="main_web" type="FlutterRunConfigurationType" factoryName="Flutter">
    <option name="additionalArgs" value="--debug --web-port=55587 --web-browser-flag=--disable-web-security" />
    <option name="filePath" value="$PROJECT_DIR$/lib/main.dart" />
    <method v="2" />
  </configuration>

Issue Description

When running my Flutter web app from VS Code on port 55586, the app resumes from where I left off after being killed and re-run. It preserves all user data, session tokens, and other information unless flutter clean is executed.

However, when running the same app from Android Studio on port 55587, the app creates a fresh instance every time it is killed and re-run. Despite using the same port, user sessions, tokens, and other information are erased.

Version info

• Flutter version 3.22.2 • Dart version 3.4.3 • DevTools version 2.34.3 • Android Studio (version 2024.1) • Flutter IntelliJ plugin version 80.0.2

Expected Behavior

The Flutter web app should preserve the user session, tokens, and other information between runs when using Android Studio, similar to the behavior in VS Code.

vinay-skycliff-it commented 1 month ago

Clone this example project and try running with both Android Studio and VS Code.