运行项目时,报如下错误:
null
java.lang.NullPointerException
at com.intellij.openapi.vfs.impl.local.LocalFileSystemBase.findFileByIoFile(LocalFileSystemBase.java:79)
at com.intellij.openapi.vfs.VfsUtil.findFileByIoFile(VfsUtil.java:232)
at com.android.tools.idea.model.ManifestInfo$ManifestFile.getLibManifests(ManifestInfo.java:406)
at com.android.tools.idea.model.ManifestInfo$ManifestFile.refresh(ManifestInfo.java:339)
at com.android.tools.idea.model.MergedManifest.syncWithReadPermission(MergedManifest.java:377)
at com.android.tools.idea.model.MergedManifest$2.run(MergedManifest.java:356)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:843)
at com.android.tools.idea.model.MergedManifest.sync(MergedManifest.java:353)
at com.android.tools.idea.model.MergedManifest.getDefaultTheme(MergedManifest.java:219)
at com.android.tools.idea.configurations.ConfigurationManager.computePreferredTheme(ConfigurationManager.java:340)
at com.android.tools.idea.configurations.Configuration.getTheme(Configuration.java:581)
at com.android.tools.idea.uibuilder.model.NlModel.updateTrackingConfiguration(NlModel.java:1987)
at com.android.tools.idea.uibuilder.model.NlModel.<init>(NlModel.java:179)
at com.android.tools.idea.uibuilder.model.NlModel.create(NlModel.java:161)
at com.android.tools.idea.uibuilder.editor.NlEditorPanel.<init>(NlEditorPanel.java:58)
at com.android.tools.idea.uibuilder.editor.NlEditor.getComponent(NlEditor.java:53)
at com.android.tools.idea.uibuilder.editor.NlEditor.getComponent(NlEditor.java:35)
at com.intellij.openapi.fileEditor.impl.EditorComposite.createEditorComponent(EditorComposite.java:187)
at com.intellij.openapi.fileEditor.impl.EditorComposite.createTabbedPaneWrapper(EditorComposite.java:176)
at com.intellij.openapi.fileEditor.impl.EditorComposite.<init>(EditorComposite.java:119)
at com.intellij.openapi.fileEditor.impl.EditorWithProviderComposite.<init>(EditorWithProviderComposite.java:40)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.createComposite(FileEditorManagerImpl.java:1020)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl4$6(FileEditorManagerImpl.java:890)
at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:2453)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4(FileEditorManagerImpl.java:971)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl3(FileEditorManagerImpl.java:788)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl2$4(FileEditorManagerImpl.java:770)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:122)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:100)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:86)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl2(FileEditorManagerImpl.java:770)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileWithProviders(FileEditorManagerImpl.java:711)
at com.intellij.openapi.fileEditor.ex.FileEditorManagerEx.openFile(FileEditorManagerEx.java:151)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openEditor$9(FileEditorManagerImpl.java:1151)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:129)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:100)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:86)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openEditor(FileEditorManagerImpl.java:1149)
at com.intellij.openapi.fileEditor.OpenFileDescriptor.navigateInAnyFileEditor(OpenFileDescriptor.java:146)
at com.intellij.openapi.fileEditor.OpenFileDescriptor.navigateInEditor(OpenFileDescriptor.java:132)
at com.intellij.openapi.fileEditor.OpenFileDescriptor.navigateInEditorOrNativeApp(OpenFileDescriptor.java:128)
at com.intellij.openapi.fileEditor.OpenFileDescriptor.navigate(OpenFileDescriptor.java:115)
at com.intellij.psi.impl.source.PsiFileImpl.navigate(PsiFileImpl.java:1007)
at com.intellij.codeInsight.navigation.NavigationUtil.openFileWithPsiElement(NavigationUtil.java:176)
at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.navigate(AbstractPsiBasedNode.java:235)
at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.navigate(AbstractPsiBasedNode.java:245)
at com.intellij.ide.projectView.impl.nodes.PsiFileNode.navigate(PsiFileNode.java:133)
at com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:53)
at com.intellij.util.OpenSourceUtil.openSourcesFrom(OpenSourceUtil.java:31)
at com.intellij.util.EditSourceOnDoubleClickHandler$TreeMouseListener.processDoubleClick(EditSourceOnDoubleClickHandler.java:130)
at com.intellij.util.EditSourceOnDoubleClickHandler$TreeMouseListener.onDoubleClick(EditSourceOnDoubleClickHandler.java:122)
at com.intellij.ui.DoubleClickListener.onClick(DoubleClickListener.java:30)
at com.intellij.ui.ClickListener$1.mouseReleased(ClickListener.java:73)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at com.intellij.ui.treeStructure.Tree.processMouseEvent(Tree.java:443)
at com.intellij.ide.dnd.aware.DnDAwareTree.processMouseEvent(DnDAwareTree.java:59)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:795)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:627)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
解决方法 Solution
Try 【Sync Project with Gradle Files】