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

时间:2014-12-13 15:49:29

标签: android android-studio intellij-idea android-gradle intellij-14

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

  

Gradle Sync

     

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 

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

3 个答案:

答案 0 :(得分:5)

理念支持向我指出了这一点:

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'

重新同步并取得成功!

答案 1 :(得分:0)

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

答案 2 :(得分:0)

这可能是最近的解决方案,我升级到14.0.3并解决了问题。