我无法运行任何项目,因为点击run
或debug
按钮(或按其各自的快捷键)会引发NPE并要求我向Google报告。
我是否应该明确提及,这是安德鲁工作室内部的错误。不是我的代码;所以我不会在这里发布任何代码,因为它可以在任何项目中发生。因此,除非你给它一个完整的阅读,否则不要给它一个downvote。
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.getActivities(MergedManifest.java:510)
at com.android.tools.idea.run.activity.DefaultActivityLocator.lambda$computeDefaultActivity$0(DefaultActivityLocator.java:79)
at com.intellij.openapi.project.DumbService$1.run(DumbService.java:89)
at com.intellij.openapi.project.DumbService$2.compute(DumbService.java:125)
at com.intellij.openapi.project.DumbService$2.compute(DumbService.java:119)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:859)
at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:119)
at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:86)
at com.android.tools.idea.run.activity.DefaultActivityLocator.computeDefaultActivity(DefaultActivityLocator.java:78)
at com.android.tools.idea.run.activity.DefaultActivityLocator.validate(DefaultActivityLocator.java:65)
at com.android.tools.idea.run.editor.DefaultActivityLaunch$State.checkConfiguration(DefaultActivityLaunch.java:49)
at com.android.tools.idea.run.AndroidRunConfiguration.checkConfiguration(AndroidRunConfiguration.java:108)
at com.android.tools.idea.run.AndroidRunConfigurationBase.validate(AndroidRunConfigurationBase.java:175)
at com.android.tools.idea.run.AndroidRunConfigurationBase.checkConfiguration(AndroidRunConfigurationBase.java:113)
at com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl.checkSettings(RunnerAndConfigurationSettingsImpl.java:423)
at com.intellij.execution.impl.RunManagerImpl.canRunConfiguration(RunManagerImpl.java:535)
at com.intellij.execution.impl.RunManagerImpl.canRunConfiguration(RunManagerImpl.java:530)
at com.intellij.execution.ProgramRunnerUtil.executeConfiguration(ProgramRunnerUtil.java:71)
at com.intellij.execution.impl.ExecutionManagerImpl.start(ExecutionManagerImpl.java:117)
at com.intellij.execution.impl.ExecutionManagerImpl.access$300(ExecutionManagerImpl.java:67)
at com.intellij.execution.impl.ExecutionManagerImpl$3.run(ExecutionManagerImpl.java:509)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:222)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:378)
at com.intellij.openapi.application.TransactionGuardImpl$6.run(TransactionGuardImpl.java:291)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:326)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:310)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
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.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:795)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:631)
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)
答案 0 :(得分:5)
也有类似的问题,但这是因为在尝试在物理设备上进行调试时,我将构建变型设置为“发布”。切换到“调试”,所有程序再次开始平稳运行。
答案 1 :(得分:4)
我刚注意到Java没有在我的机器上运行。这是问题的根源。
我有一个Macbook pro,当我运行Android Studio时,Java的图标将添加到docker中。我不知道为什么这次没有自动启动,很奇怪。因此,我不得不按下同步项目(虽然项目已经同步)只是为了强制Java运行!然后,通常的图标被添加到docker,一切正常!