diff --git a/build.gradle b/build.gradle index 4f297afe86..4ee24a686f 100644 --- a/build.gradle +++ b/build.gradle @@ -78,7 +78,7 @@ intellij { localPath "${project.rootDir.absolutePath}/artifacts/$ide" downloadSources false def pluginList = [project(':flutter-idea'), "java", "Dart:$dartVersion", "properties", "junit", "Git4Idea", - "Kotlin", "gradle", "android", "Groovy", "smali", "IntelliLang"] + "Kotlin", "gradle", "org.jetbrains.android", "Groovy", "smali", "IntelliLang"] if (ide == 'android-studio') { pluginList.add(project(':flutter-studio')) } else if ("$buildSpec" == '2020.3') { diff --git a/flutter-idea/build.gradle b/flutter-idea/build.gradle index 5c7f73bf1d..952d8c358a 100644 --- a/flutter-idea/build.gradle +++ b/flutter-idea/build.gradle @@ -50,7 +50,7 @@ intellij { downloadSources false localPath "${project.rootDir.absolutePath}/artifacts/$ide" plugins "java", "Dart:$dartVersion", "properties", "junit", "Kotlin", "Git4Idea", - "gradle", "android", "Groovy", "smali", "IntelliLang" + "gradle", "Groovy", "smali", "IntelliLang", "org.jetbrains.android" } dependencies { diff --git a/flutter-studio/build.gradle b/flutter-studio/build.gradle index 7e01fa2e96..fba3f6a172 100644 --- a/flutter-studio/build.gradle +++ b/flutter-studio/build.gradle @@ -38,7 +38,7 @@ intellij { downloadSources false localPath "${project.rootDir.absolutePath}/artifacts/$ide" plugins "java", "Dart:$dartVersion", "properties", "junit", - "gradle", "android", "Groovy", "smali", "IntelliLang", "android"//"org.jetbrains.android" + "gradle", "Groovy", "smali", "IntelliLang", "org.jetbrains.android" } sourceSets { diff --git a/resources/META-INF/plugin.xml b/resources/META-INF/plugin.xml index 8b4e820553..a877688bb7 100644 --- a/resources/META-INF/plugin.xml +++ b/resources/META-INF/plugin.xml @@ -23,6 +23,10 @@ SNAPSHOT + com.intellij.modules.platform + com.intellij.modules.lang + com.intellij.modules.xdebugger + org.jetbrains.android Dart Git4Idea diff --git a/resources/META-INF/plugin_template.xml b/resources/META-INF/plugin_template.xml index 9eb990d70a..53de8543e0 100644 --- a/resources/META-INF/plugin_template.xml +++ b/resources/META-INF/plugin_template.xml @@ -21,6 +21,10 @@ @VERSION@ + com.intellij.modules.platform + com.intellij.modules.lang + com.intellij.modules.xdebugger + org.jetbrains.android Dart Git4Idea diff --git a/src/io/flutter/ProjectOpenActivity.java b/src/io/flutter/ProjectOpenActivity.java index 68e0638182..ad87138925 100644 --- a/src/io/flutter/ProjectOpenActivity.java +++ b/src/io/flutter/ProjectOpenActivity.java @@ -61,14 +61,14 @@ public void runActivity(@NotNull Project project) { if (FlutterSettings.getInstance().isEnableEmbeddedBrowsers()) { JxBrowserManager.getInstance().setUp(project); } + excludeAndroidFrameworkDetector(project); final FlutterSdk sdk = FlutterSdk.getIncomplete(project); if (sdk == null) { // We can't do anything without a Flutter SDK. + // Note: this branch is taken when opening a project immediately after creating it -- not sure that is expected. return; } - // TODO(messick) Re-enable this after dropping support for 2020.2. - //excludeAndroidFrameworkDetector(project); // Report time when indexing finishes. DumbService.getInstance(project).runWhenSmart(() -> { @@ -101,10 +101,14 @@ public void runActivity(@NotNull Project project) { } private static void excludeAndroidFrameworkDetector(@NotNull Project project) { - DetectionExcludesConfiguration excludesConfiguration = DetectionExcludesConfiguration.getInstance(project); - FrameworkType type = new AndroidFrameworkDetector().getFrameworkType(); - if (!excludesConfiguration.isExcludedFromDetection(type)) { - excludesConfiguration.addExcludedFramework(type); + try { + final DetectionExcludesConfiguration excludesConfiguration = DetectionExcludesConfiguration.getInstance(project); + final FrameworkType type = new AndroidFrameworkDetector().getFrameworkType(); + if (!excludesConfiguration.isExcludedFromDetection(type)) { + excludesConfiguration.addExcludedFramework(type); + } + } catch (NoClassDefFoundError ignored) { + // This should never happen. But just in case ... } } @@ -121,6 +125,7 @@ public PackagesOutOfDateNotification(@NotNull Project project, @NotNull PubRoot myProject = project; myRoot = root; + //noinspection DialogTitleCapitalization addAction(new AnAction("Run 'flutter pub get'") { @Override public void actionPerformed(@NotNull AnActionEvent event) {