我在使用 Android Studio 导入 gradle 项目时遇到问题。我选择我的应用程序的文件夹,然后选择“为 external_model 导入项目”当我单击下一步时,我的控制台中触发了一个错误。这就是痕迹:
ERROR - com.intellij.ide.IdeEventQueue - Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(1084,751),absolute(1685,1041),button=1,modifiers=Button1,clickCount=1] on dialog0
java.lang.IllegalStateException: @NotNull method com/intellij/openapi/externalSystem/model/settings/LocationSettingType.getColor must not return null
at com.intellij.openapi.externalSystem.model.settings.LocationSettingType.getColor(LocationSettingType.java:54)
at org.jetbrains.plugins.gradle.service.settings.GradleProjectSettingsControl.deduceGradleHomeIfPossible(GradleProjectSettingsControl.java:279)
at org.jetbrains.plugins.gradle.service.settings.GradleProjectSettingsControl.resetExtraSettings(GradleProjectSettingsControl.java:236)
at com.intellij.openapi.externalSystem.service.settings.AbstractExternalProjectSettingsControl.reset(AbstractExternalProjectSettingsControl.java:65)
at com.intellij.openapi.externalSystem.service.settings.AbstractImportFromExternalSystemControl.reset(AbstractImportFromExternalSystemControl.java:153)
at com.intellij.openapi.externalSystem.service.project.wizard.AbstractExternalProjectImportBuilder.prepare(AbstractExternalProjectImportBuilder.java:107)
at com.intellij.openapi.externalSystem.service.project.wizard.SelectExternalProjectStepBase.initGradleSettingsControl(SelectExternalProjectStepBase.java:90)
at com.intellij.openapi.externalSystem.service.project.wizard.SelectExternalProjectStepBase.updateStep(SelectExternalProjectStepBase.java:44)
at com.intellij.ide.util.newProjectWizard.AddModuleWizard.updateStep(AddModuleWizard.java:172)
at com.intellij.ide.wizard.AbstractWizard.doNextAction(AbstractWizard.java:377)
at com.intellij.ide.util.newProjectWizard.AddModuleWizard.doNextAction(AddModuleWizard.java:241)
at com.intellij.ide.wizard.AbstractWizard$5.actionPerformed(AbstractWizard.java:197)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
我尝试重新安装 Android Studio,对其进行更新(0.1.1、0.1.7、0.1.8 版本)并且总是出现相同的错误。我在 Ubuntu 12.04 LTS 上,我的 JDK 版本是 1.6.0_26 我也尝试安装 gradle 1.6 并将 bin 文件夹添加到我的路径,但它不起作用。