From 2fdca0fd36efbb9cdb8f1aaa0894c80549fffe31 Mon Sep 17 00:00:00 2001 From: Daniel Alome Date: Tue, 21 Apr 2026 01:03:33 +0100 Subject: [PATCH] ADFA-3784: java.lang.ClassCastException: java.util.Collections cannot be cast to kotlin.collections.EmptyList --- app/proguard-rules.pro | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 8e0c6b47a9..c7432b4c59 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -136,6 +136,16 @@ ## Prevent R8 from moving what it thinks as unused classes -dontshrink +## Plugin SPI +## Plugins are loaded dynamically via DexClassLoader, so R8 cannot see their +## implementations of these interfaces. Without these rules, R8 narrows the +## return types of default interface methods (e.g. UIExtension.getEditorTabs +## returning emptyList()) to EmptyList, then inserts CHECKCAST at call sites. +## When a plugin returns a non-EmptyList (listOf(x), mutableListOf(), etc), +## the cast fails at runtime. +-keep class com.itsaky.androidide.plugins.** { *; } +-keep interface com.itsaky.androidide.plugins.** { *; } + ## Initial rules to enable when R8 is shrinking to address exceptions #-keep class com.sun.tools.jdi.** { *; } #-keep class com.sun.jdi.** { *; }