diff --git a/flutter-idea/src/io/flutter/utils/FlutterModuleUtils.java b/flutter-idea/src/io/flutter/utils/FlutterModuleUtils.java index b5a23fe5d4..86fe87f50b 100644 --- a/flutter-idea/src/io/flutter/utils/FlutterModuleUtils.java +++ b/flutter-idea/src/io/flutter/utils/FlutterModuleUtils.java @@ -341,21 +341,19 @@ public static boolean convertFromDeprecatedModuleType(@NotNull Project project) return modulesConverted; } + // Return true if there is a module with the same name as the project plus the Android suffix. public static boolean hasAndroidModule(@NotNull Project project) { - boolean isAllMatch = true; for (PubRoot root : PubRoots.forProject(project)) { assert root != null; String name = PubspecYamlUtil.getDartProjectName(root.getPubspec()); String moduleName = name + "_android"; - boolean isMatch = false; for (Module module : FlutterModuleUtils.getModules(project)) { if (moduleName.equals(module.getName())) { - isMatch = true; + return true; } } - isAllMatch = isAllMatch && isMatch; } - return isAllMatch; + return false; } public static boolean isDeprecatedFlutterModuleType(@NotNull Module module) {