我今天打开了我的Android Studio,它要求升级到我所做的最新版本。
现在我无法创建新项目。我按照向导创建一个项目,它完成了创建项目,但结果不是我所期望的,我在控制台中收到错误
我得到的错误是:
Can't deserialize target data of key 'IdeaAndroidProject'. Given class loaders: [PluginClassLoader[org.jetbrains.android, 10.0]]: Can't deserialize target data of key 'IdeaAndroidProject'. Given class loaders: [PluginClassLoader[org.jetbrains.android, 10.0]]
java.lang.IllegalStateException: Can't deserialize target data of key 'IdeaAndroidProject'. Given class loaders: [PluginClassLoader[org.jetbrains.android, 10.0]]
at com.intellij.openapi.externalSystem.model.DataNode.prepareData(DataNode.java:159)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManager.ensureTheDataIsReadyToUse(ProjectDataManager.java:110)
at com.intellij.openapi.externalSystem.service.project.manage.ProjectDataManager.importData(ProjectDataManager.java:80)
at com.intellij.openapi.externalSystem.service.project.wizard.AbstractExternalProjectImportBuilder$1$1$1.run(AbstractExternalProjectImportBuilder.java:140)
at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.mergeRootsChangesDuring(ProjectRootManagerImpl.java:314)
at com.intellij.openapi.externalSystem.service.project.wizard.AbstractExternalProjectImportBuilder$1$1.run(AbstractExternalProjectImportBuilder.java:137)
at com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil$6$1.run(ExternalSystemApiUtil.java:323)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1002)
at com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil$6.run(ExternalSystemApiUtil.java:320)
at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2003)
at com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil.executeOnEdt(ExternalSystemApiUtil.java:340)
at com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil.executeProjectChangeAction(ExternalSystemApiUtil.java:318)
at com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil.executeProjectChangeAction(ExternalSystemApiUtil.java:314)
at com.intellij.openapi.externalSystem.service.project.wizard.AbstractExternalProjectImportBuilder$1.run(AbstractExternalProjectImportBuilder.java:134)
at com.intellij.ide.startup.impl.StartupManagerImpl$7.run(StartupManagerImpl.java:286)
at com.intellij.ide.startup.impl.StartupManagerImpl.runActivities(StartupManagerImpl.java:259)
at com.intellij.ide.startup.impl.StartupManagerImpl.access$100(StartupManagerImpl.java:52)
at com.intellij.ide.startup.impl.StartupManagerImpl$4.run(StartupManagerImpl.java:183)
at com.intellij.openapi.project.DumbServiceImpl.runWhenSmart(DumbServiceImpl.java:94)
at com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartupActivities(StartupManagerImpl.java:177)
at com.intellij.openapi.project.impl.ProjectManagerImpl$4$2.run(ProjectManagerImpl.java:439)
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:686)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:514)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:339)
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.io.InvalidClassException: com.android.build.gradle.internal.model.ArtifactInfoImpl; local class incompatible: stream classdesc serialVersionUID = 8019119530161366598, local class serialVersionUID = 4262527033625760143
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:570)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1599)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1494)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1748)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1969)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1775)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:349)
at java.util.HashMap.readObject(HashMap.java:1030)
at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:979)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1775)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1969)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1775)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1969)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:478)
at org.gradle.tooling.internal.adapter.ProtocolToModelAdapter$InvocationHandlerImpl.readObject(ProtocolToModelAdapter.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:979)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1775)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1969)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1775)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1969)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1775)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:349)
at com.intellij.openapi.externalSystem.model.DataNode.prepareData(DataNode.java:155)
... 37 more
当我尝试导入时,它会做同样的事情。
答案 0 :(得分:7)
我必须要求您提供Android Studio内部版本号和系统环境。但我认为以下步骤可能有所帮助。如果有任何法术错误,请为英语不好而感到抱歉。
在Windows 7 x64下 Android Studio 130.737825
首先,检查您的Android Studio版本。当版本为130.737825时,我遇到了问题。无论如何更新Android Studio。 “帮助 - >检查更新”
如果它不起作用。
http://tools.android.com/recent
检查最新版本号或
http://dl.google.com/android/studio/patches/updates.xml
检查最新版本。
下载更新包 像这样https://dl.google.com/android/studio/patches/AI-130.737825-132.821530-patch-win.jar 请根据自己的情况选择合适的一个。格式为AI- $ FROM- $ TO-patch-win.jar $ From是Android工作室的内部版本号。 $ TO是您要更新的最新版本号。
将包下载到Android Studio目录。 d:\ Android的\ Android的工作室。 运行cmd
D:\Android\android-studio>java -classpath AI-130.737825-132.821530-patch-win.jar com.intellij.updater.Runner install .
答案 1 :(得分:1)
将我的项目移动到与我的Android Studio相同的分区似乎已经解决了我的问题。 这不是一个永久性的解决方案,但如果你想在修复之前继续工作,你就必须这样做......
答案 2 :(得分:0)
我有这个错误,你的用户文件夹是否位于除安装android studio之外的驱动器上?
我会将此作为评论,但不能。
答案 3 :(得分:0)
正如贝壳所说:
警告:您正在使用OpenJDK Java运行时启动IDE。
ITS KNOWN TO HAVE PERFORMANCE AND GRAPHICS ISSUES!
SWITCH TO THE ORACLE(SUN) JDK BEFORE REPORTING PROBLEMS!
注意:如果安装了Oracle(Sun)JDK和OpenJDK 请将STUDIO_JDK,JDK_HOME或JAVA_HOME环境变量点验证为有效的Oracle(Sun)JDK安装。 有关切换默认JDK的详细信息,请参阅http://ow.ly/6TuKQ。
我认为这是问题所在。你必须将android-studio的jdk切换到正确的路径。
答案 4 :(得分:0)
我在Win7-x64上遇到了同样的问题。我用JAWA_HOME(转到控制面板 - >系统 - >环境变量)用双引号输入了jdk(c:\ Program Files \ Java \ jdk1.7.0_40)的路径。删除引号可以解决问题。
答案 5 :(得分:0)
在Ubuntu 13.10 x86_64上,更新(在撰写本文时为v.0.3.1)也解决了问题。 要像某些已经列出的那样更新,只需点击“帮助 - >检查更新”。