我的项目中有4个模块。我可以使用Android Studio 0.2.0版创建新模块。
两天前,我将Android Studio升级到0.2.5,现在当我去创建一个新模块时,窗口没有显示任何选项。
我无法通过文件执行“新模块” - > “新建模块”或通过在“项目”工具窗口中右键单击我的项目名称。
如果我按完成,Android Studio会抛出NullPointerException
。这是控制台输出:
null
java.lang.NullPointerException
at com.android.tools.idea.wizard.TemplateWizardModuleBuilder.createModule(TemplateWizardModuleBuilder.java:177)
at com.android.tools.idea.wizard.NewModuleWizardrun(NewModuleWizard.java:82)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1021)
at com.android.tools.idea.wizard.NewModuleWizard.createModule(NewModuleWizard.java:79)
at com.android.tools.idea.actions.AndroidNewModuleAction.actionPerformed(AndroidNewModuleAction.java:45)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:162)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitterrun(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(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:703)
at java.awt.EventQueue.access(EventQueue.java:102)
at java.awt.EventQueuerun(EventQueue.java:662)
at java.awt.EventQueuerun(EventQueue.java:660)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomaindoIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomaindoIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueuerun(EventQueue.java:676)
at java.awt.EventQueuerun(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomaindoIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:673)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:679)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:503)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:332)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
答案 0 :(得分:0)
我可以通过手动创建新文件夹并复制/粘贴来添加新模块:
然后,如果您重新启动Android Studio,它应该会看到它是一个新模块。
这不是最好的解决方案,但同时也是一种解决方法。