Android Studio 4.1 changed from class to interface. Now it's incompatible with an IntelliJ IDEA


I have a plugin and it worked well until google released a version of the Android Studio 4.1.

The plugin uses import and import

Ddmlib was located as a separate library in the path IntelliJ IDEA

In the android studio 4.1+ it was moved to a file Android and the class  was changed to the interface.

Android Studio 4.1 (201.8743.12.41)

public interface Client {

IntellijIDEA 201.8743.12 

public class Client extends JdwpAgent {

The plugin works fine in the IntellijIDEA but has an exception in Android Studio 4.1

java.lang.IncompatibleClassChangeError: Found interface, but class was expected

When I recompiled the plugin with the sources of Android Studio 4.1 it started to work fine there. 

But now it doesn't work in the IntellijIDEA because of the backward exception:

Method AdbController.createProcessList(IDevice) has invocation invokeinterface instruction referencing an interface method Client.getClientData(), but the method's host Client is a class. 
This can lead to IncompatibleClassChangeError at runtime.

Please, help me with how to manage the issue. I can fix it for Android Studio OR for IntellijIDEA but I can't to make it work for both IDE because of the difference of the same class. 

Comment actions Permalink

It seems the only solution is to provide dedicated version of your plugin targeting specific IDE/version range.

Alternatively, you could try wrapping this in some loader service to load correct implementation via reflection depending on current IDE.

Comment actions Permalink

Tel me please, how to include sources from `Android` current plugin ? By default includes classes from ` IntelliJ IDEA` Thanks!


Please sign in to leave a comment.