Crashlytics Android Studio插件无法初始化

时间:2014-03-17 19:55:58

标签: android-studio crashlytics

我正在运行Android Studio 0.5.1。我已经下载了Crashlytics Android Studio插件并从光盘安装了它。当我重新启动Android Studio时,我收到以下异常

Plugin 'com.crashlytics.tools.androidstudio' failed to initialize and will be disabled.  Please restart Android Studio.

java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:471)
    at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:189)
    at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:185)
    at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:161)
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:124)
    at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:77)
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:66)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at com.crashlytics.tools.intellij.OSGiPluginServices.createOSGi(OSGiPluginServices.java:62)
    at com.crashlytics.tools.intellij.CrashlyticsPlugin.initComponent(CrashlyticsPlugin.java:89)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:548)
    at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:590)
    at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:225)
    at com.intellij.util.pico.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:212)
    at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:199)
    at org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer.getComponentInstance(AbstractDelegatingMutablePicoContainer.java:75)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponent(ComponentManagerImpl.java:121)
    at com.intellij.openapi.application.impl.ApplicationImpl.createComponent(ApplicationImpl.java:371)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:112)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:89)
    at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:87)
    at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:508)
    at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:150)
    at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:46)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
    at java.awt.EventQueue.access$400(EventQueue.java:82)
    at java.awt.EventQueue$2.run(EventQueue.java:676)
    at java.awt.EventQueue$2.run(EventQueue.java:674)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassNotFoundException: org.osgi.framework.BundleActivator PluginClassLoader[com.crashlytics.tools.androidstudio, 1.5.0]
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:68)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 44 more

6 个答案:

答案 0 :(得分:63)

来自Crashlytics的Hemal来了!你可以继续尝试安装plugin.zip文件而不是jar,让我知道这是否有效?

答案 1 :(得分:12)

使用 Fabric工具。您无需编写任何代码。请查看以下步骤,在您的应用中安装Crashlytics

  1. 进入此Fabric link。然后签名 注册并登录您的帐户。

  2. 在Android Studio中,点击文件 - >设置 - > plugin->在顶部搜索栏中,搜索此Fabric for Android,然后点击浏览,您会看到结构安卓工作室文件。

  3. 然后下载 Fabric Android Studio Plugin.Zip file.finally,重启Android Studio

  4. 然后你可以在eclipse工具中看到Fabric图标。检查 截图截止日期:

    enter image description here

  5. 登录面料 - >输入组织 - >单击安装crashlytics工具。它将添加代码 自动。你不需要写一行代码。它会 在manifest文件和build.gradle中添加代码。

  6. 成功安装后,运行您的应用程序。如果您的 应用程序崩溃后,会在fabric dashboard

  7. 中通知您
  8. <强>输出:

    下面我在仪表板中发布了崩溃报告:

    enter image description here

  9. 进一步参考:Crashlytics

答案 2 :(得分:2)

我遇到了这个错误&#34; NoClassDefFoundError:javax / swing / SwingUtilities&#34;

我必须下载并使用jdk1.7.0_65而不是jdk1.8.0_05并更改环境变量中的路径。

希望这有助于某人!

答案 3 :(得分:2)

天哪,我认为它不起作用,但确实如此!它现在在工具栏中显示图标,但我在crashlytics上分配热键,它会弹出下面的(!)IDEA CE 13.1.4屏幕。 enter image description here

答案 4 :(得分:2)

对于你们使用safari下载插件的人。使用其他一些赢得自动解压缩容器的浏览器。

Android studio要求您安装压缩文件,而不是个人.jar:s

编辑: 另一个选择是去Safari - &gt;首选项并取消选中自动打开选项。 谢谢@m vai

答案 5 :(得分:0)

选择&#34;插件&#34;在“设置”对话框的右侧。单击&#34;从磁盘安装插件...&#34;并选择 已下载 zip 文件。 不要解压缩文件。选择 已下载 zip 文件。