flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.98k stars 319 forks source link

Open for editing in android studio keep closing #7304

Closed badshah-badmas closed 6 months ago

badshah-badmas commented 7 months ago

What happened

I tried to edit java file of a flutter project in android studio. But i can't open the project with "Open for editing in android studio" option that shows in flutter plugin. When I click the option, Android studio keep closing with the error log shown below.

Version information

Android Studio Iguana | 2023.2.1 Patch 1 • Flutter plugin io.flutter 78.4.1 • Dart plugin 232.10305

Flutter 3.19.4 • channel stable • https://github.com/flutter/flutter.git Framework • revision 68bfaea224 (7 days ago) • 2024-03-20 15:36:31 -0700 Engine • revision a5c24f538d Tools • Dart 3.3.2 • DevTools 2.31.1

Exception

null

java.lang.IllegalStateException: configureNewProject should be used with new projects only
    at com.android.tools.idea.gradle.project.importing.GradleProjectImporter$Companion.configureNewProject(GradleProjectImporter.kt:204)
    at com.android.tools.idea.gradle.project.importing.GradleProjectImporter$importAndOpenProjectCore$1$1$1.invokeSuspend(GradleProjectImporter.kt:99)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at com.intellij.openapi.application.impl.DispatchedRunnable.run(DispatchedRunnable.kt:43)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:208)
    at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:190)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
    at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:478)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:79)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:121)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
    at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:690)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$10(IdeEventQueue.kt:593)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWithoutImplicitRead(ApplicationImpl.java:1485)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:593)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:997)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:997)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
    at com.intellij.openapi.progress.impl.PlatformTaskSupportKt.pumpEventsForHierarchy(PlatformTaskSupport.kt:379)
    at com.intellij.openapi.progress.impl.PlatformTaskSupportKt.access$pumpEventsForHierarchy(PlatformTaskSupport.kt:1)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$2.invoke(PlatformTaskSupport.kt:157)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$2.invoke(PlatformTaskSupport.kt:135)
    at com.intellij.openapi.application.impl.ModalityKt.inModalContext(modality.kt:12)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport.runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:135)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport.access$runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:41)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$1.invoke(PlatformTaskSupport.kt:123)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$1.invoke(PlatformTaskSupport.kt:119)
    at com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:94)
    at com.intellij.openapi.progress.impl.PlatformTaskSupport.runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:119)
    at com.intellij.openapi.progress.TasksKt.runWithModalProgressBlocking(tasks.kt:167)
    at com.intellij.ide.impl.ProjectUtilKt.runUnderModalProgressIfIsEdt(ProjectUtil.kt:710)
    at com.intellij.openapi.project.impl.ProjectManagerImpl.openProject(ProjectManagerImpl.kt:546)
    at com.android.tools.idea.gradle.project.importing.GradleProjectImporter.importAndOpenProjectCore(GradleProjectImporter.kt:90)
    at io.flutter.actions.OpenAndroidModule.openOrImportProject(OpenAndroidModule.java:64)
    at io.flutter.actions.OpenAndroidModule.actionPerformed(OpenAndroidModule.java:52)
    at io.flutter.actions.OpenInAndroidStudioAction.actionPerformed(OpenInAndroidStudioAction.java:60)
    at io.flutter.editor.NativeEditorNotificationProvider$NativeEditorActionsPanel.performAction(NativeEditorNotificationProvider.java:143)
    at com.intellij.ui.EditorNotificationPanel$6.handlePanelActionClick(EditorNotificationPanel.java:442)
    at com.intellij.ui.EditorNotificationPanel$ActionHyperlinkLabel$1.hyperlinkActivated(EditorNotificationPanel.java:487)
    at com.intellij.ui.HyperlinkAdapter.hyperlinkUpdate(HyperlinkAdapter.java:14)
    at com.intellij.ui.HyperlinkLabel.fireHyperlinkEvent(HyperlinkLabel.java:242)
    at com.intellij.ui.HyperlinkLabel.processMouseEvent(HyperlinkLabel.java:164)
    at java.desktop/java.awt.Component.processEvent(Unknown Source)
    at java.desktop/java.awt.Container.processEvent(Unknown Source)
    at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
    at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
    at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:690)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:638)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:592)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:997)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:997)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
musthafa-pk commented 7 months ago

Not yet

jwren commented 6 months ago

Duplicate of https://github.com/flutter/flutter-intellij/issues/7103