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

时间:2017-02-07 19:40:08

标签: android-studio

我正在尝试在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 个答案:

答案 0 :(得分:0)

我无法保证这是您的解决方案,但使用此方法安装后我没有遇到任何问题。

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

然后使用

重新安装终端
sudo apt-add-repository ppa:paolorotolo/android-studio
sudo apt-get update
sudo apt-get install android-studio

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

归功于我最初找到此方法的https://itsfoss.com/install-android-studio-ubuntu-linux/