Android Studio中项目同步期间的NoClassDefFoundError

时间:2017-05-27 21:17:29

标签: android android-studio android-gradle

Android Studio停止工作。项目无法同步。我收到一个错误:

项目刷新失败 错误:C:\ Users \ ?????。gradle \ native \ 23 \ windows-i386 \ native-platform.dll:找不到依赖库

Google的日志:

Could not initialize class com.sun.jna.Native
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
at com.intellij.util.text.DateFormatUtil.getWindowsFormats(DateFormatUtil.java:433)
at com.intellij.util.text.DateFormatUtil.getDateTimeFormats(DateFormatUtil.java:335)
at com.intellij.util.text.DateFormatUtil.<clinit>(DateFormatUtil.java:59)
at com.intellij.openapi.wm.impl.status.StatusPanel$5.run(StatusPanel.java:218)
at com.intellij.openapi.wm.impl.status.StatusPanel.updateText(StatusPanel.java:225)
at com.intellij.openapi.wm.impl.status.InfoAndProgressPanel.setText(InfoAndProgressPanel.java:479)
at com.intellij.openapi.wm.impl.status.IdeStatusBarImpl.lambda$setInfo$3(IdeStatusBarImpl.java:465)
at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2432)
at com.intellij.openapi.wm.impl.status.IdeStatusBarImpl.setInfo(IdeStatusBarImpl.java:463)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:377)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:364)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:350)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:343)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:42)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:226)
at com.sun.proxy.$Proxy103.setInfo(Unknown Source)
at com.intellij.openapi.wm.StatusBar$Info.set(StatusBar.java:57)
at com.intellij.openapi.wm.StatusBar$Info.set(StatusBar.java:43)
at com.intellij.ui.components.labels.LinkLabel.setStatusBarText(LinkLabel.java:273)
at com.intellij.ui.components.labels.LinkLabel.disableUnderline(LinkLabel.java:265)
at com.intellij.ui.components.labels.LinkLabel.removeNotify(LinkLabel.java:201)
at java.awt.Container.removeNotify(Container.java:2804)
at javax.swing.JComponent.removeNotify(JComponent.java:4758)
at java.awt.Container.removeNotify(Container.java:2804)
at javax.swing.JComponent.removeNotify(JComponent.java:4758)
at java.awt.Container.removeAll(Container.java:1297)
at com.intellij.openapi.wm.impl.status.InfoAndProgressPanel.buildInProcessCount(InfoAndProgressPanel.java:325)
at com.intellij.openapi.wm.impl.status.InfoAndProgressPanel.removeProgress(InfoAndProgressPanel.java:257)
at com.intellij.openapi.wm.impl.status.InfoAndProgressPanel.access$800(InfoAndProgressPanel.java:64)
at com.intellij.openapi.wm.impl.status.InfoAndProgressPanel$MyInlineProgressIndicator.lambda$finish$0(InfoAndProgressPanel.java:684)
at com.intellij.openapi.application.TransactionGuardImpl$6.run(TransactionGuardImpl.java:291)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:326)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:310)
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.defaultDispatchEvent(IdeEventQueue.java:795)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:631)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
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)

还有更多:

Could not initialize class com.sun.jna.Native
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.Native
at com.sun.jna.platform.win32.WinDef$ULONGLONG.<clinit>(WinDef.java:843)
at com.intellij.ui.Win7TaskBar.<clinit>(Win7TaskBar.java:50)
at com.intellij.ui.AppIcon$Win7AppIcon._hideProgress(AppIcon.java:410)
at com.intellij.ui.AppIcon$BaseIcon.hideProgress(AppIcon.java:101)
at com.intellij.openapi.project.DumbServiceImpl$AppIconProgress.lambda$finish$1(DumbServiceImpl.java:561)
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.defaultDispatchEvent(IdeEventQueue.java:795)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:631)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
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)

还有更多:

Could not initialize class com.intellij.ui.Win7TaskBar
java.lang.NoClassDefFoundError: Could not initialize class com.intellij.ui.Win7TaskBar
at com.intellij.ui.AppIcon$Win7AppIcon._hideProgress(AppIcon.java:410)
at com.intellij.ui.AppIcon$BaseIcon.hideProgress(AppIcon.java:101)
at com.intellij.ui.AppIcon$BaseIcon$1.applicationActivated(AppIcon.java:150)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:377)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:364)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:343)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:42)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:226)
at com.sun.proxy.$Proxy73.applicationActivated(Unknown Source)
at com.intellij.ide.ApplicationActivationStateManager.setActive(ApplicationActivationStateManager.java:135)
at com.intellij.ide.ApplicationActivationStateManager.updateState(ApplicationActivationStateManager.java:83)
at com.intellij.ide.IdeEventQueue.processAppActivationEvents(IdeEventQueue.java:758)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:520)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
at java.awt.SequencedEvent.dispatch(SequencedEvent.java:128)
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.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:795)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:631)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
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)

昨天一切正常。没有任何改变。 我重新安装了Android Studio。问题仍然存在。

请帮帮我!!!

1 个答案:

答案 0 :(得分:1)

我认为这是某些最新版本中的错误

  

我的用户名由西里尔字母组成

其中解释了C:\Users\?????\.gradle\

它无法加载路径C:\Users\?????下的任何文件,因此失败。

直到解决任何错误的解决方案:创建没有西里尔字母的用户帐户