Repository: flutter
Issue: Plugins are displayed as modules in Android Studio [existing app as module]
Labels: tool,a: existing-apps,P3,team-tool,triaged-tool

*@Sese-Schneider commented on Oct 3, 2019, 10:24 AM UTC:*

## Steps to Reproduce

1.  Add a flutter project _with plugins_ to an existing android app as described [here (as module)](https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps#2-depend-on-the-modules-source-code)
2.  Open the existing android app in Android Studio
3.  Sync files with gradle
4.  All plugins (in cache) will appear as separate modules in Android Studio, the changes are saved in `.idea/modules.xml` (existing app)
5.  Even after removing the modules from this file, after the next gradle sync they are added back.

Please change the sync in a way plugins are not added to modules.

## Examples

`modules.xml`

```
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
      <module fileurl="file://$PROJECT_DIR$/international.iml" filepath="$PROJECT_DIR$/international.iml" />
      <module fileurl="file://$PROJECT_DIR$/flutter/.android/Flutter/flutter.iml" filepath="$PROJECT_DIR$/flutter/.android/Flutter/flutter.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/cloud_firestore-0.12.9+4/android/cloud_firestore.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/cloud_firestore-0.12.9+4/android/cloud_firestore.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/git/plugins-71e809bd88c937dd480620d6a3610e48293018fc/packages/firebase_analytics/android/firebase_analytics.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/git/plugins-71e809bd88c937dd480620d6a3610e48293018fc/packages/firebase_analytics/android/firebase_analytics.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/firebase_auth-0.14.0+5/android/firebase_auth.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/firebase_auth-0.14.0+5/android/firebase_auth.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/firebase_core-0.4.0+8/android/firebase_core.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/firebase_core-0.4.0+8/android/firebase_core.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/firebase_performance-0.3.0+5/android/firebase_performance.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/firebase_performance-0.3.0+5/android/firebase_performance.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/firebase_remote_config-0.2.0+7/android/firebase_remote_config.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/firebase_remote_config-0.2.0+7/android/firebase_remote_config.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/firebase_storage-3.0.6/android/firebase_storage.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/firebase_storage-3.0.6/android/firebase_storage.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/flutter_full_pdf_viewer-1.0.5/android/flutter_full_pdf_viewer.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/flutter_full_pdf_viewer-1.0.5/android/flutter_full_pdf_viewer.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/flutter_inapp_purchase-1.0.1/android/flutter_inapp_purchase.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/flutter_inapp_purchase-1.0.1/android/flutter_inapp_purchase.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/google_sign_in-4.0.6/android/google_sign_in.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/google_sign_in-4.0.6/android/google_sign_in.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/path_provider-1.3.0/android/path_provider.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/path_provider-1.3.0/android/path_provider.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/purchases_flutter-0.3.2/android/purchases_flutter.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/purchases_flutter-0.3.2/android/purchases_flutter.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/sqflite-1.1.6+4/android/sqflite.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/sqflite-1.1.6+4/android/sqflite.iml" />
      <module fileurl="file://$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/url_launcher-5.1.2/android/url_launcher.iml" filepath="$USER_HOME$/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/url_launcher-5.1.2/android/url_launcher.iml" />
    </modules>
  </component>
</project>

```

Screenshots:

[![](https://camo.githubusercontent.com/f5d771353507954a99ea3eef8800da9c3ec219a0/68747470733a2f2f736373686f742e6465657073706163652e6f6e6c2f62313262326233642d616361642d346332612d393237652d6563366539386563313661362e706e67)](https://camo.githubusercontent.com/f5d771353507954a99ea3eef8800da9c3ec219a0/68747470733a2f2f736373686f742e6465657073706163652e6f6e6c2f62313262326233642d616361642d346332612d393237652d6563366539386563313661362e706e67)
[![](https://camo.githubusercontent.com/be1e8ea48a36ad84e120ccb4ff9ee57f7d3ec8ec/68747470733a2f2f736373686f742e6465657073706163652e6f6e6c2f30333465323062612d653333352d346361382d383138382d3863306562333437356135342e706e67)](https://camo.githubusercontent.com/be1e8ea48a36ad84e120ccb4ff9ee57f7d3ec8ec/68747470733a2f2f736373686f742e6465657073706163652e6f6e6c2f30333465323062612d653333352d346361382d383138382d3863306562333437356135342e706e67)

## Logs

```
[√] Flutter (Channel master, v1.10.8-pre.21, on Microsoft Windows [Version 10.0.18980.1], locale en-US)
    • Flutter version 1.10.8-pre.21 at X:\Flutter
    • Framework revision fa7340a328 (11 hours ago), 2019-10-02 19:04:50 -0400
    • Engine revision 73dd5a33d9
    • Dart version 2.6.0 (build 2.6.0-dev.4.0 eaf1c308ab)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at X:\SDK
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = X:\SDK
    • Java binary at: X:\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Android Studio (version 3.5)
    • Android Studio at X:\Android Studio
    • Flutter plugin version 40.0.2
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] IntelliJ IDEA Ultimate Edition (version 2019.1)
    • IntelliJ at X:\JetBrains\IntelliJ IDEA
    • Flutter plugin version 37.0.3
    • Dart plugin version 191.7830

[√] Connected device (1 available)
    • ONEPLUS A5000 • 92948006 • android-arm64 • Android 9 (API 28)

• No issues found!

```

*This issue was moved by [stevemessick](https://github.com/stevemessick) from [flutter/flutter-intellij#3930](https://github.com/flutter/flutter-intellij/issues/3930).*