Android Studio学习遇到的错误NoClassDefFoundError
今天在学的过程中准备安装一下字节开源安卓开发利器-CodeLocator时遇到了一个插件兼容性问题,无法启动AS
问题描述:
Internal error. Please refer to https://code.google.com/p/android/issues
java.lang.NoClassDefFoundError: okhttp3/Callback
at com.bytedance.tools.codelocator.listener.CodeLocatorApplicationInitializedListener.componentsInitialized(CodeLocatorApplicationInitializedListener.java:67)
Caused by: java.lang.ClassNotFoundException: okhttp3.Callback PluginClassLoader(plugin=PluginDescriptor(name=CodeLocator, id=com.bytedance.tools.codelocator, descriptorPath=plugin.xml, path=~\AppData\Roaming\Google\AndroidStudio2023.1\plugins\CodeLocatorPlugin-2.0.4.jar, version=2.0.4, package=null, isBundled=false), packagePrefix=null, instanceId=119, state=active)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.kt:150)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 10 more
Your JRE: 17.0.7+0-b2043.56-10550314 amd64 (JetBrains s.r.o.)
D:\android\android-studio\jbr
这是问题是我在安装codeLocator时遇到的,这主要是插件兼容性的问题,我使用的android studio版本是Android Studio版本 (2023.1),而安装的codeLocator的版本是CodeLocatorPlugin-2.0.4,目前的最新版,然后就遇到了这个问题CodeLocatorPlugin (字节跳动开发的一个调试工具插件) 无法找到 okhttp3.Callback 类
然后再我安装完插件,并且再build.gradle.kts加入相关依赖,然后重新android studio准备启动插件后,studio就无法进入了
解决:
1、关闭所有AS的相关进程:
- 打开任务管理器 (Ctrl+Shift+Esc)
- 确保所有Android Studio相关进程已结束
2、找到并删除插件文件
- 从错误信息中可以看到插件路径: ~\AppData\Roaming\Google\AndroidStudio2023.1\plugins\CodeLocatorPlugin-2.0.4.jar
- 打开文件资源管理器
- 导航到: C:\Users\您的用户名\AppData\Roaming\Google\AndroidStudio2023.1\plugins\
- 删除或重命名 CodeLocatorPlugin-2.0.4.jar 文件
3、重启AS
更多推荐
所有评论(0)