【ClassNotFoundException】After upgrading android studio to the latest version, my plugin reports an error Follow
Caused by: java.lang.ClassNotFoundException: com.android.layoutinspector.model.ClientWindow PluginClassLoader(plugin=PluginDescriptor(name=LayoutVerify, id= , descriptorPath=plugin.xml, path=E:\ALM\LayoutVerify1\LayoutVerifyPlugin\build\idea-sandbox\plugins\LayoutVerify, version=1.0-SNAPSHOT, package=null, isBundled=false), packagePrefix=null, instanceId=78, state=active)
Caused by: java.lang.ClassNotFoundException: com.android.layoutinspector.model.ClientWindow PluginClassLoader(plugin=PluginDescriptor(name=LayoutVerify, id=com..LayoutVerify, descriptorPath=plugin.xml, path=E:\ALM\LayoutVerify1\LayoutVerifyPlugin\build\idea-sandbox\plugins\LayoutVerify, version=1.0-SNAPSHOT, package=null, isBundled=false), packagePrefix=null, instanceId=78, state=active)
Please sign in to leave a comment.
Please be more specific. What is your Gradle build script? What was the previous and new version?
old studio version
This problem does not appear in older versions
I have now updated the dependency to the latest 2022.2.3 version, and under this version, it can still be found in "com.android.layoutinspector.model"
You can see the ClientWindow class in this path. But the latest code in studio does not see this class under the branch studio-2020.3.1, this class exists under the branch master
How to use this class correctly in the latest Android studio version
This class is available in the setup from your first build script screenshot (IC 2021.3 + "android" plugin). Maybe you didn't reimport the project, or something went wrong.
After the build file is updated, the corresponding local dependency package is also updated. No error will be reported during the compilation process. An error will be reported only after the plugin runs to the latest android studio. This class seems to no longer exist in the latest android studio environment. .
Please help to answer this question, thanks
810829096, I confused. Are you developing a plugin for Android Studio or IDEA?
IDEA 2022.1 is not the same as Android Studio 2022.1. It is easier to comprehend if we denote 2 parts explicitly: there is Android Plugin (AP) and IJ platform (IJ)
You can always find which Android plugin is integrated into IDEA through settings|plugins:
If your target platform is Android Studio, please use Android Studio itself for development:
In general, plugin developed for IC-a.b.c is not compatible with AS-a.b.c, and vise versa. You need 2 different plugins for 2 different IDEs in most cases.
It seems ClientWindow has been deleted in EE (maybe in Dolphin). I didn't find exact commit where this happened, but this commit implies that legacy-layout-inspector has gone and you need to use some different APIs: https://android.googlesource.com/platform/tools/adt/idea/+/1362c00fb1d73482deede80edf3b9e7af11dcc22
I just found that now we support `AI` product codes: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-type
So you can use `AI` instead of `IC` or `localPath`
Thank you for your answer. First of all, my plugin is for Android studio. My question is why there is this class in the developed dependency package but not in the actual Android studio runtime environment. If this path has been deleted in the actual environment, why Do not delete together in dependent packages? code 'AI' doesn't seem to be supported
Hi, regarding the support for AI, you need to use the latest Gradle IntelliJ Plugin.