8

我有一個Android Studio項目,我想開始使用Intellij 14 Ultimate來利用它提供的一些很酷的功能。當我嘗試打開我的項目,我得到一個消息說:Android的搖籃插件如何將Android Studio(1.0)項目導入Intellij 14 Ultimate

搖籃同步

版本1.0.0-RC4要求搖籃空或更高版本。未找到當地的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 

我也嘗試導入項目並獲得類似結果。有任何想法嗎?

+0

你是否更新過sdk管理器中的所有文件? – SuncoastOwner 2014-12-13 16:18:26

回答

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' 

重新同步,成功!

+0

當時我寫這篇文章的時候,IJ 14並不是最新的Android Studio 1.0版本,但Jet Blains知道它,我想它會和他們的下一個版本同步。 – 2014-12-13 18:03:39

+0

感謝您的信息斯科特。你知道他們是否打算保持AS和intellij的android插件同步嗎?或者插件會稍微落後於最新版本的AS? – bmurmistro 2014-12-13 18:25:36

+0

對兩個問題都是這樣,實際上。他們從頭開始選擇Android Studio /插件源代碼,但不經常發佈。 – 2014-12-15 16:44:27

0

我今晚有同樣的事情發生在我身上,但它提供了一個鏈接,下載最新的Gradle依賴項。我下載了它,它解決了我所有的問題,它可能會解決你所有的問題!

+0

謝謝你指出。這是有道理的,我使用gradlew包裝,而不是下載的版本。 – bmurmistro 2014-12-16 13:02:14

0

這可能是一個最近的解決方案,我升級到14.0.3並解決了問題。

相關問題