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

Bug when opening flutter project inside android studio #5399

Open zakblacki opened 3 years ago

zakblacki commented 3 years ago

What happened

Everytime I open my IDE I get this exception below

Also I'm having another error I'm not sure if it's related I tried deleting both iml and workspace file that did not work

Cannot load settings from file android.url_launcher_web.iml': File does not exist please correct the file content

Version information

Android Studio 4.1.3 • Flutter plugin io.flutter 55.0.1 • Dart plugin 201.9335

Error getting Flutter sdk information.

Exception

null

java.lang.Throwable: com.intellij.openapi.components.PathMacroManager is registered as application service, but requested as project one
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:146)
    at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:420)
    at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:394)
    at com.intellij.openapi.components.PathMacroManager.getInstance(PathMacroManager.java:27)
    at com.intellij.configurationStore.ProjectStoreImpl.<init>(ProjectStoreImpl.kt:47)
    at com.intellij.configurationStore.ProjectWithModulesStoreImpl.<init>(ProjectStoreImpl.kt:154)
    at com.intellij.configurationStore.PlatformLangProjectStoreFactory.createStore(ProjectStoreImpl.kt:187)
    at io.flutter.android.AndroidModuleLibraryManager$EmbeddedAndroidProject.<init>(AndroidModuleLibraryManager.java:337)
    at io.flutter.android.AndroidModuleLibraryManager.doGradleSync(AndroidModuleLibraryManager.java:227)
    at io.flutter.android.AndroidModuleLibraryManager.update(AndroidModuleLibraryManager.java:105)
    at io.flutter.android.AndroidModuleLibraryManager.updateAndroidLibraries(AndroidModuleLibraryManager.java:219)
    at com.intellij.openapi.project.DumbServiceImpl.lambda$smartInvokeLater$8(DumbServiceImpl.java:623)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:310)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:80)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:128)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
    at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:184)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:974)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:847)
    at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:449)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:741)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:496)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    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)
stevemessick commented 3 years ago

The current implementation of the option that indexes the android module is too fragile. I want to see if doing something similar to add-to-app support would work. That would turn the Flutter project into a Gradle project.

stevemessick commented 3 years ago

The change was not as simple as I'd hoped. Moving to next release.