英文:
unable to open project structure and module settings
问题
我的错误发生在我将手机连接到笔记本电脑上运行我的应用程序时,一切都正常。但是在连接手机之前运行了应用程序。因此,应用程序在模拟器上运行,Gradle 开始同步。所以我停止了它,然后在手机上重新运行它。我使用的是 Windows 10。
Gradle 同步了整整一天,运行按钮被禁用,并显示(应用更改并重新启动活动 [已禁用意外异常])。
我无法打开“文件” > “项目结构”或模块设置(F4)。
在 logcat 中我看到了以下内容(在当前项目中不支持运行配置应用程序。无法获取应用程序 ID)。
我尝试重新启动项目并使缓存无效,然后同步 Gradle 文件,但没有帮助。
我收到一条消息,显示(IDE 错误发生),并显示了此页面:页面
这是该页面上的内容:
`java.security.PrivilegedActionException: java.security.PrivilegedActionException: java.io.FileNotFoundException: C:\Users\Elhoseny\moaz coffee\app\build\intermediates\apk_ide_redirect_file\debug\..\..\apk\debug\output-metadata.json(系统找不到指定的文件)
在 java.base/java.security.AccessController.doPrivileged(本地方法)中
在 java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)中
在 java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)中
在 com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:885)中
在 com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:814)中
在 com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:751)中
在 com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:441)中
在 com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)中
在 com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:440)中
在 com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)中
在 com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)中
在 java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)中
在 java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)中
在 java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)中
在 java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)中
在 java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)中
在 java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)中
由 java.security.PrivilegedActionException: java.io.FileNotFoundException: C:\Users\Elhoseny\moaz coffee\app\build\intermediates\apk_ide_redirect_file\debug\..\..\apk\debug\output-metadata.json(系统找不到指定的文件)引起
在 java.base/java.security.AccessController.doPrivileged(本地方法)中
在 java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)中
在 java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)中
在 java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)中
在 java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)中
... 17 more
由 java.io.FileNotFoundException: C:\Users\Elhoseny\moaz coffee\app\build\intermediates\apk_ide_redirect_file\debug\..\..\apk\debug\output-metadata.json(系统找不到指定的文件)引起
在 java.base/java.io.FileInputStream.open0(本地方法)中
在 java.base/java.io.FileInputStream.open(FileInputStream.java:219)中
在 java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)中
在 java.base/java.io.FileReader.<init>(FileReader.java:75)中
在 com.android.ide.common.build.GenericBuiltArtifactsLoader.loadFromFile(GenericBuiltArtifactsLoader.kt:76)中
在 com.android.tools.idea.gradle.util.GradleBuildOutputUtil.loadBuildOutputListingFile(GradleBuildOutputUtil.kt:131)中
在 com.android.tools.idea.gradle.project.model.GradleAndroidModel.getGenericBuiltArtifactsUsingCache(GradleAndroidModel.java:699)中
在 com.android.tools.idea.gradle.project.model.GradleAndroidModel.getGenericBuiltArtifactsWithTimestamp(GradleAndroidModel.java:677)中
在 com.android.tools.idea.gradle.project.model.GradleAndroidModel.getApplicationIdUsingCache(GradleAndroidModel.java:658)中
在 com.android.tools.idea.gradle.project.model.GradleAndroidModel.getApplicationIdUsingCache(GradleAndroidModel.java:650)中
在 com.android.tools.idea.gradle.project.model.GradleAndroidModel.getApplicationId(GradleAndroidModel.java:303)中
在 com.android.tools.idea.stats.UsageTrackerUtils.getApplicationId(extensions.kt:82)中
在 com.android.tools.idea.stats.UsageTrackerUtils.withProjectId(extensions.kt:61)中
在 com.android.tools.idea.structure.dialog.ProjectStructureConfigurable.logUsageOpen(ProjectStructureConfigurable.kt:481)中
在 com.android.tools.idea.structure.dialog.ProjectStructureConfigurable.showPlace(ProjectStructureConfigurable.kt:261)中
在 com.android.tools.idea.gradle.structure.AndroidProjectSettingsServiceImpl.showNewPsd(AndroidProjectSettingsServiceImpl.java:104)中
在 com.android.tools.idea.gradle.structure.AndroidProjectSettingsServiceImpl.openModuleSettings(AndroidProjectSettingsServiceImpl.java:110)中
在 com.intellij.ide.projectView.impl.nodes.AbstractModuleNode.navigate(AbstractModuleNode.java:96)中
在 com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:83)中
在 com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:58)中
在 com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:51)中
在 com.intellij.ide.actions.BaseNavigateToSourceAction.actionPerformed(BaseNavigateToSourceAction.java:24)中
在 com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:240)中
在 com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:261)中
在 com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:240)
<details>
<summary>英文:</summary>
My error starts when I plug in my mobile phone into my laptop to run my app and everything was fine. But I run the app before my phone was plugged in. So the app run on the simulator and the Gradle started syncing. So I stopped it and rerun it on my phone I'm using windows 10
So the Gradle sync all day and the run button is disabled and says (Apply changes and restart activity [disabled unexpected exception])
And I can't open File>project structure or module settings (F4).
And I got this in logcat (Run configuration app is not supported in the current project. Cannot obtain the application ID)
I restart the project and Invalidate caches and sync project with Gradle files but nothing helps
And I got a message that says (IDE error occurred) and it shows this [page](https://i.stack.imgur.com/MSuTy.png)
and this is what is written on that page
java.security.PrivilegedActionException: java.security.PrivilegedActionException: java.io.FileNotFoundException: C:\Users\Elhoseny\moaz coffee\app\build\intermediates\apk_ide_redirect_file\debug\..\..\apk\debug\output-metadata.json (The system cannot find the file specified)
... 22 more
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:885)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:814)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:751)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:441)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:440)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.security.PrivilegedActionException: java.io.FileNotFoundException: C:\Users\Elhoseny\moaz coffee\app\build\intermediates\apk_ide_redirect_file\debug\..\..\apk\debug\output-metadata.json (The system cannot find the file specified)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
... 17 more
Caused by: java.io.FileNotFoundException: C:\Users\Elhoseny\moaz coffee\app\build\intermediates\apk_ide_redirect_file\debug\..\..\apk\debug\output-metadata.json (The system cannot find the file specified)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at java.base/java.io.FileReader.<init>(FileReader.java:75)
at com.android.ide.common.build.GenericBuiltArtifactsLoader.loadFromFile(GenericBuiltArtifactsLoader.kt:76)
at com.android.tools.idea.gradle.util.GradleBuildOutputUtil.loadBuildOutputListingFile(GradleBuildOutputUtil.kt:131)
at com.android.tools.idea.gradle.project.model.GradleAndroidModel.getGenericBuiltArtifactsUsingCache(GradleAndroidModel.java:699)
at com.android.tools.idea.gradle.project.model.GradleAndroidModel.getGenericBuiltArtifactsWithTimestamp(GradleAndroidModel.java:677)
at com.android.tools.idea.gradle.project.model.GradleAndroidModel.getApplicationIdUsingCache(GradleAndroidModel.java:658)
at com.android.tools.idea.gradle.project.model.GradleAndroidModel.getApplicationIdUsingCache(GradleAndroidModel.java:650)
at com.android.tools.idea.gradle.project.model.GradleAndroidModel.getApplicationId(GradleAndroidModel.java:303)
at com.android.tools.idea.stats.UsageTrackerUtils.getApplicationId(extensions.kt:82)
at com.android.tools.idea.stats.UsageTrackerUtils.withProjectId(extensions.kt:61)
at com.android.tools.idea.structure.dialog.ProjectStructureConfigurable.logUsageOpen(ProjectStructureConfigurable.kt:481)
at com.android.tools.idea.structure.dialog.ProjectStructureConfigurable.showPlace(ProjectStructureConfigurable.kt:261)
at com.android.tools.idea.gradle.structure.AndroidProjectSettingsServiceImpl.showNewPsd(AndroidProjectSettingsServiceImpl.java:104)
at com.android.tools.idea.gradle.structure.AndroidProjectSettingsServiceImpl.openModuleSettings(AndroidProjectSettingsServiceImpl.java:110)
at com.intellij.ide.projectView.impl.nodes.AbstractModuleNode.navigate(AbstractModuleNode.java:96)
at com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:83)
at com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:58)
at com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:51)
at com.intellij.ide.actions.BaseNavigateToSourceAction.actionPerformed(BaseNavigateToSourceAction.java:24)
at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:240)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:261)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:240)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$performAction$0(ActionMenuItem.java:277)
at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:236)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:67)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.performAction(ActionMenuItem.java:269)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:284)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$2(ActionMenuItem.java:111)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:111)
at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:515)
at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:545)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6652)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
at java.desktop/java.awt.Component.processEvent(Component.java:6417)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2784)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
</details>
# 答案1
**得分**: 1
我最终通过构建> 清理项目... 构建> 重新构建项目来解决了这个错误。
<details>
<summary>英文:</summary>
I finally solved the error by build> clean project..... build> rebuild project
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论