Skip to content

Fix AbstractMethodError when opening the git panel - #82

Merged
AhmadKharfan merged 1 commit into
developfrom
fix/git-panel-abstract-method-error
Jul 30, 2026
Merged

Fix AbstractMethodError when opening the git panel#82
AhmadKharfan merged 1 commit into
developfrom
fix/git-panel-abstract-method-error

Conversation

@AhmadKharfan

Copy link
Copy Markdown
Owner

Why

Opening the Git panel in the editor crashed the app:

java.lang.AbstractMethodError: abstract method "void com.ahmadkharfan.androidstudiolite.feature.git.api.GitPanelApi.Panel(
    java.lang.String, kotlin.jvm.functions.Function0, ..., androidx.compose.runtime.Composer, int)"
    at ...GitPanelApi$ComposeDefaultImpls.Panel$default(GitPanelApi.kt:21)
    at ...EditorDrawerKt.EditorToolPanelContent(EditorDrawer.kt:248)

GitPanelApi.Panel declared default argument values. For a @Composable interface member, the Compose compiler emits a ComposeDefaultImpls.Panel$default bridge that calls the abstract method with a synthesised signature. While the interface and its implementation lived in the same module that resolved fine. Once the interface moved to :feature:git:api and GitPanelApiImpl stayed in :feature:git, the bridge in one module no longer matched the override compiled in the other.

It compiles cleanly, passes detekt, passes every unit test, and throws the first time the panel is composed. Nothing in the JVM test suite can see it.

What changed

Removed the default values from GitPanelApi.Panel. The single call site in EditorDrawer already passed all eight arguments explicitly, so the defaults were never used — they were pure liability across a module boundary. A comment on the interface records why they must not come back.

The LongParameterList baseline entry was re-keyed, since the signature string changed with the defaults removed.

Behavior

Fixes a crash. The Git panel now opens.

Tests

  • 714 tests passing, 0 failures. No test change: the JVM suite could not have caught this, and adding one that could would mean instrumentation.

Verification

Verified on an emulator (API 36, x86_64), which is how the bug was found in the first place:

  • Before: opening the editor drawer and selecting Git → FATAL EXCEPTION: AbstractMethodError
  • After: the panel renders correctly, showing "Git · HEAD" and the "Not a git repository" empty state, with no exception in logcat

Also re-checked on device while here, all clean:

  • Editor opens from the hub
  • The Terminal tab renders a live session inside the editor's bottom panel, which exercises the app-supplied terminal slot and confirms the native PTY still binds after the JNI package rename
  • Create project → browse location → select folder returns /storage/emulated/0/Documents into the Save location field, confirming saved-state result delivery through the feature-owned route key

./gradlew test detekt verifyModuleBoundaries — BUILD SUCCESSFUL.

@AhmadKharfan
AhmadKharfan merged commit 298fa29 into develop Jul 30, 2026
3 checks passed
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.

1 participant