Plugin tests are launched against AndroidStudio, but PlatformUtils.isAndroidStudio is not found (NoClassDefFoundError)

Answered

I run unit tests against Android Studio LadyBug.

Under the hood, com.intellij.util.PlatformUtils.isAndroidStudio is invoked. However, NoClassDefFoundError is thrown. I have attached screenshot from debugger, which illustrates the problem.

Is it possible, that platform prefix is “AndroidStudio”, but method “isAndroidStudio” is absent? Or is it a bug?

If I try to launch development instance (runIde task) and invoke PlatformUtils.isAndroidStudio, then it works fine. For some reason, the method disappears in tests.

0
1 comment

Hi,

I don't see isAndroidStudio in this class (I also briefly went through the class history). Please clarify where did you find it. At first sight it seems that you use different IDEs or versions for tests and runIde tasks.

Anyway, PlatformUtils is an internal API and shouldn't be used. The recommended approach for implementing IDE-specific behavior is mentioned in its Javadoc:
https://github.com/JetBrains/intellij-community/blob/master/platform/core-api/src/com/intellij/util/PlatformUtils.java#L24-L25

0

Please sign in to leave a comment.