如何将Android Studio(1.0)项目导入Intellij 14 Ultimate

我有一个Android Studio项目,我想开始使用Intellij 14 Ultimate来利用它提供的一些很酷的function。 当我尝试打开我的项目时,我收到一条消息:

Gradle同步

Android Gradle插件的1.0.0-rc4版本需要Gradle null或更新。 没有发现当地的Gradle分布….

点击“确定”使用Gradle包装器。

我点击确定,它会尝试同步,但失败。 这是错误控制台说:

Gradle版本2.2是必需的。 当前版本是2.1。 如果使用gradle包装,请尝试编辑〜gradle-wrapper.properties〜中的distributionUrl

我修改文件点击“再试一次”

什么都没发生。 以下是日志文件中的内容:

2014-12-13 09:40:23,845 [ 572317] ERROR - llij.ide.plugins.PluginManager - null java.lang.AssertionError at com.android.tools.idea.gradle.project.PreSyncChecks.attemptToUpdateGradleVersionInWrapper(PreSyncChecks.java:175) at com.android.tools.idea.gradle.project.PreSyncChecks.ensureCorrectGradleSettings(PreSyncChecks.java:72) at com.android.tools.idea.gradle.project.PreSyncChecks.canSync(PreSyncChecks.java:53) at com.android.tools.idea.gradle.project.GradleProjectImporter.doImport(GradleProjectImporter.java:439) at com.android.tools.idea.gradle.project.GradleProjectImporter.doRequestSync(GradleProjectImporter.java:219) at com.android.tools.idea.gradle.project.GradleProjectImporter.access$000(GradleProjectImporter.java:77) at com.android.tools.idea.gradle.project.GradleProjectImporter$2.run(GradleProjectImporter.java:184) at com.intellij.ui.AppUIUtil.invokeLaterIfProjectAlive(AppUIUtil.java:77) at com.android.tools.idea.gradle.project.GradleProjectImporter.requestProjectSync(GradleProjectImporter.java:191) at com.android.tools.idea.gradle.project.GradleProjectImporter.requestProjectSync(GradleProjectImporter.java:166) at com.android.tools.idea.editors.ProjectSyncStatusNotificationProvider$ProjectImportFailedNotificationPanel$1.run(ProjectSyncStatusNotificationProvider.java:105) at com.intellij.ui.EditorNotificationPanel$2.hyperlinkActivated(EditorNotificationPanel.java:95) at com.intellij.ui.HyperlinkAdapter.hyperlinkUpdate(HyperlinkAdapter.java:28) at com.intellij.ui.HyperlinkLabel.fireHyperlinkEvent(HyperlinkLabel.java:187) at com.intellij.ui.HyperlinkLabel.processMouseEvent(HyperlinkLabel.java:120) at java.awt.Component.processEvent(Component.java:6281) at java.awt.Container.processEvent(Container.java:2229) at java.awt.Component.dispatchEventImpl(Component.java:4872) at java.awt.Container.dispatchEventImpl(Container.java:2287) at java.awt.Component.dispatchEvent(Component.java:4698) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4489) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422) at java.awt.Container.dispatchEventImpl(Container.java:2273) at java.awt.Window.dispatchEventImpl(Window.java:2719) at java.awt.Component.dispatchEvent(Component.java:4698) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87) at java.awt.EventQueue$4.run(EventQueue.java:708) at java.awt.EventQueue$4.run(EventQueue.java:706) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:705) at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:748) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:573) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:384) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) 2014-12-13 09:40:23,846 [ 572318] ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA 14.0.2 Build #IU-139.659.2 2014-12-13 09:40:23,846 [ 572318] ERROR - llij.ide.plugins.PluginManager - JDK: 1.7.0_71 2014-12-13 09:40:23,846 [ 572318] ERROR - llij.ide.plugins.PluginManager - VM: Java HotSpot(TM) 64-Bit Server VM 2014-12-13 09:40:23,846 [ 572318] ERROR - llij.ide.plugins.PluginManager - Vendor: Oracle Corporation 2014-12-13 09:40:23,846 [ 572318] ERROR - llij.ide.plugins.PluginManager - OS: Mac OS X 2014-12-13 09:40:23,846 [ 572318] ERROR - llij.ide.plugins.PluginManager - Last Action: $Copy 

我也试过导入项目并得到类似的结果。 有任何想法吗?

Solutions Collecting From Web of "如何将Android Studio(1.0)项目导入Intellij 14 Ultimate"

意见支持指出了这一点:

https://youtrack.jetbrains.com/issue/IDEA-134118

基本上改变我的gradle依赖修复它

 //For Android Studio //classpath 'com.android.tools.build:gradle:1.0.0-rc4' // For Intellij classpath 'com.android.tools.build:gradle:0.14.4' 

重新同步和成功!

今晚我有同样的事情发生,但它提供了一个链接,下载最新的Gradle依赖。 我下载了它,它解决了我所有的问题,它可能会解决你所有的问题!

这可能是一个最近的解决scheme,我升级到14.0.3,它解决了这个问题。