Skip to content

Fix split debugging error in 2026.1#8877

Closed
helin24 wants to merge 4 commits into
flutter:mainfrom
helin24:split-debugging
Closed

Fix split debugging error in 2026.1#8877
helin24 wants to merge 4 commits into
flutter:mainfrom
helin24:split-debugging

Conversation

@helin24
Copy link
Copy Markdown
Member

@helin24 helin24 commented Mar 31, 2026

Fixes #8831

This includes a small set of changes to use new APIs while debugging, and changes to our build files to contain these changes to 2026.1 only.

I'm inclined to make a new branch for platform version 2026.1 for this change:

  • Even though the deprecated API (XDebugSessionImpl.getRunContentDescriptor) throws an error, the alternative recommended is marked experimental (XSessionStartedResult), so I don't think it makes sense to commit this to main.
  • The build changes are temporary - since Android Studio hasn't released 2026.1 yet, I had to remove some Android Studio-specific files from src so that we can compile the plugin against IntelliJ IDEA instead. But once Android Studio 2026.1 is released, then we should revert most of the build changes and go back to compiling against that.

Alternatively, we could use reflection to get rid of the error. I will try to push up a draft for that as well.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the project to target Java 21 and Kotlin 2.3, upgrades the IntelliJ platform version to 2026.1, and refactors debug session creation to use the modern XDebuggerManager.newSessionBuilder API. Feedback includes addressing code duplication in the build file's exclusion lists, removing dead commented-out plugin configurations, and cleaning up a placeholder token in the properties file.

Comment thread build.gradle.kts
Comment on lines +158 to +172
java.exclude("**/AndroidStudioGradleSyncProvider.java")
java.exclude("**/GradleUtils.java")
java.exclude("**/FlutterExternalSystemTaskNotificationListener.java")
java.exclude("**/AndroidLocationProvider.java")
java.exclude("**/FlutterStudioStartupActivity.java")
java.exclude("**/OpenAndroidModule.java")
java.exclude("**/AddToAppUtils.java")

kotlin.exclude("**/AndroidStudioGradleSyncProvider.java")
kotlin.exclude("**/GradleUtils.java")
kotlin.exclude("**/FlutterExternalSystemTaskNotificationListener.java")
kotlin.exclude("**/AndroidLocationProvider.java")
kotlin.exclude("**/FlutterStudioStartupActivity.java")
kotlin.exclude("**/OpenAndroidModule.java")
kotlin.exclude("**/AddToAppUtils.java")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

[CONCERN] The list of excluded files is duplicated for both Java and Kotlin source sets. This violates the DRY (Don't Repeat Yourself) principle and increases the maintenance burden. Consider defining the list once and applying it to both source sets.

    val androidStudioExcludes = listOf(
      "**/AndroidStudioGradleSyncProvider.java",
      "**/GradleUtils.java",
      "**/FlutterExternalSystemTaskNotificationListener.java",
      "**/AndroidLocationProvider.java",
      "**/FlutterStudioStartupActivity.java",
      "**/OpenAndroidModule.java",
      "**/AddToAppUtils.java"
    )
    java.exclude(androidStudioExcludes)
    kotlin.exclude(androidStudioExcludes)

Comment thread build.gradle.kts Outdated
Comment on lines +252 to +253
// this doesn't seem to make a difference
// plugin("com.android.tools.idea.smali:261.22158.182")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

[CONCERN] This commented-out plugin and the accompanying note ("this doesn't seem to make a difference") should be removed to keep the build file clean and free of dead code.

Comment thread gradle.properties

org.gradle.caching=true
org.gradle.configuration-cache=true
token=dummy
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

[CONCERN] The addition of token=dummy appears to be a leftover from local development or CI testing. Unless this property is strictly required by the build system, it should be removed to maintain a clean configuration file.

@helin24
Copy link
Copy Markdown
Member Author

helin24 commented Mar 31, 2026

Closing in favor of #8878

@helin24 helin24 closed this Mar 31, 2026
auto-submit Bot pushed a commit that referenced this pull request Apr 1, 2026
Fixes #8831

There is an API change somewhere in 2025.3 which causes the error to be thrown during debugging.

I considered making this a separate plugin branch in #8877.

To test this change in IntelliJ IDEA 2026.1:
- Debug an app
- Debug a test
- Attach an app (Run menu > Flutter Attach, then start the app on device)
- I don't have a way to test bazel code. It should probably be removed.
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 this pull request may close these issues.

Error during debug application for IDEA 2026.1

1 participant