由于ClassNotFoundException,Android Studio无法启动:com.android.sdklib.repository.AndroidSdkHandler

时间:2022-01-25 20:54:04

I'm trying to start android studio in ubuntu 16.04. I'm using java 8 and $JAVA_HOME is set correctly. but when i start android studio it throws this error

我正在尝试在ubuntu 16.04中启动android studio。我正在使用java 8和$ JAVA_HOME设置正确。但是当我启动android studio时它会抛出这个错误

java.lang.NoClassDefFoundError: com/android/sdklib/repository/AndroidSdkHandler
at com.android.tools.idea.welcome.wizard.InstallComponentsPath.<init>(InstallComponentsPath.java:90)
at com.android.tools.idea.welcome.wizard.FirstRunWizard.init(FirstRunWizard.java:63)
at com.android.tools.idea.welcome.wizard.FirstRunWizardHost.setupWizard(FirstRunWizardHost.java:99)
at com.android.tools.idea.welcome.wizard.FirstRunWizardHost.getWelcomePanel(FirstRunWizardHost.java:91)
at com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrame.<init>(FlatWelcomeFrame.java:104)
at com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrameProvider.createFrame(FlatWelcomeFrameProvider.java:29)
at com.intellij.openapi.wm.impl.welcomeScreen.WelcomeFrame.showNow(WelcomeFrame.java:171)
at com.intellij.idea.IdeaApplication$IdeStarter.main(IdeaApplication.java:340)
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:200)
at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:52)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Caused by: java.lang.ClassNotFoundException: com.android.sdklib.repository.AndroidSdkHandler PluginClassLoader[org.jetbrains.android, 10.2.2.3]
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:64)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 25 more

1 个解决方案

#1


0  

I can't guarantee this as a solution for you, but having installed using this method I have had no trouble.

我不能保证这是一个解决方案,但使用这种方法我没有遇到任何麻烦。

Uninstall (by whatever method is appropriate for you)

卸载(通过适合您的任何方法)

Then reinstall with the terminal using

然后使用终端重新安装

sudo apt-add-repository ppa:paolorotolo/android-studio
sudo apt-get update
sudo apt-get install android-studio

I must stress that this adds and installs from an unofficial repository so it is up to you to decide if you are comfortable with installing from an unofficial source

我必须强调,这会从一个非官方的存储库中添加和安装,因此由您来决定是否适合从非官方来源安装

Credit to https://itsfoss.com/install-android-studio-ubuntu-linux/ where I originally found this method.

感谢https://itsfoss.com/install-android-studio-ubuntu-linux/我最初找到这种方法。

#1


0  

I can't guarantee this as a solution for you, but having installed using this method I have had no trouble.

我不能保证这是一个解决方案,但使用这种方法我没有遇到任何麻烦。

Uninstall (by whatever method is appropriate for you)

卸载(通过适合您的任何方法)

Then reinstall with the terminal using

然后使用终端重新安装

sudo apt-add-repository ppa:paolorotolo/android-studio
sudo apt-get update
sudo apt-get install android-studio

I must stress that this adds and installs from an unofficial repository so it is up to you to decide if you are comfortable with installing from an unofficial source

我必须强调,这会从一个非官方的存储库中添加和安装,因此由您来决定是否适合从非官方来源安装

Credit to https://itsfoss.com/install-android-studio-ubuntu-linux/ where I originally found this method.

感谢https://itsfoss.com/install-android-studio-ubuntu-linux/我最初找到这种方法。