7

我无法在 Android Studio 中使用后端生成功能。我按照这篇博客文章尝试为我的应用程序设置后端,但是我收到以下 IDE 错误:

插件 Maven 集成中的异常

Argument 0 for @NotNull parameter of com/intellij/util/containers/ContainerUtil.map must not be null: Argument 0 for @NotNull parameter of com/intellij/util/containers/ContainerUtil.map must not be null
java.lang.IllegalArgumentException: Argument 0 for @NotNull parameter of com/intellij/util/containers/ContainerUtil.map must not be null
    at com.intellij.util.containers.ContainerUtil.map(ContainerUtil.java)
    at org.jetbrains.idea.maven.utils.MavenUtil.collectFiles(MavenUtil.java:247)
    at org.jetbrains.idea.maven.wizards.MavenProjectBuilder.commit(MavenProjectBuilder.java:129)
    at com.intellij.projectImport.ProjectImportBuilder.commit(ProjectImportBuilder.java:59)
    at com.google.gct.intellij.endpoints.externalbuilder.MavenBackendGeneratorHelper.addMavenFunctionality(MavenBackendGeneratorHelper.java:216)
    at com.google.gct.intellij.endpoints.externalbuilder.ui.GenerateMavenBackend.actionPerformed(GenerateMavenBackend.java:115)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:162)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:260)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:892)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:114)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:230)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:104)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:512)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:44)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:532)
    at java.awt.Component.processMouseEvent(Component.java:6505)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
    at java.awt.Component.processEvent(Component.java:6270)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4861)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    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:4687)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:688)
    at java.awt.EventQueue$3.run(EventQueue.java:686)
    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:702)
    at java.awt.EventQueue$4.run(EventQueue.java:700)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:686)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:510)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:339)
    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)

该过程完成后,我只生成了 -AppEngine 模块,没有 -endpoints 模块。

我确定 Maven 已在我的机器上正确设置,我检查了这个问题,该问题也抱怨无法生成后端。

这个问题有解决方案吗?

4

3 回答 3

1

【windows 8】获取0.4.0 Android Studio,新建项目,点击选择Tools>Google Cloud Tools>Generate App Engine

提供项目编号和项目 ID 和 API 密钥,来自 https://cloud.google.com/console#/project 看起来你已经知道了

这将生成 -AppEngine 和 -endpoints

在左侧项目浏览器中选择 -endpoints,然后选择 Tools>Google Cloud Tools>Generate Client Libraries(这使得 .war 与 app-engine 一起部署,因此 app-engine 代码可以处理端点代码)

点击最右上角竖写的“Maven Projects”,点击Plugins>appengine,点击appengine:update

这将部署 appengine。

(2014 年 1 月 7 日)您必须返回控制台并重新选择正确的版本,以便应用程序向端点服务注册。

转到此处: https://cloud.google.com/console#/project,然后单击 AppEngine,然后单击版本,然后单击最新版本,然后单击设为默认值

于 2014-01-08T02:43:04.933 回答
1

新的解决方案是转到File > New Module > More Modules > AppEngine Java Endpoints Module

这是一个 Google I/O 视频,其中描述了有关设置步骤的更多信息: https ://www.youtube.com/watch?v=KBhOkfbbZLk

Google 的 Cloud Tools 文档中也有此链接: https ://cloud.google.com/mobile/app_engine/add_module

于 2014-12-03T20:35:45.087 回答
0

您应该需要将 Google API 包安装到您的工作区中..然后,只有您可以访问相同的..否则,它只显示错误..

于 2013-10-19T04:48:16.823 回答