title: Only Android Application Modules can be connected to Firebase online projects
body: <p>In Android Studio 3.2.1 I select:<br>
  New flutter Application, I then enter<br>
  Application Name: sample_firebase_app<br>
  I Select Next  and the application is created in:<br>
  D:\Flutter\SampleFirebaseApplication  </p>
  
  <p>A new Flutter application for Firebase
  Company Name: mycompanyname.com
  I Include kotlin support but No Swift Support, it produces the main.dart   </p>
  
  <pre><code>class MyApp extends StatelessWidget {
    // This widget is the root of your application.
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
  </code></pre>
  
  <p>Project ID: homeassistantmobile</p>
  
  <p>On the Firebase website I create a new project:<br>
  HomeAssistantMobile</p>
  
  <p>I then select the option to add a firebase application<br>
  I add the application ID from my build.gradle<br>
  com.mycompanyname.samplefirebaseapp</p>
  
  <p>I register the application<br>
  It then offers me the option of downloading the google-services.json  </p>
  
  <p>The firebase website shows this going in the location:<br>
  My-Application/app
  But I don't have that file structure so I put it in 
  D:\Flutter\SampleFirebaseApplication\sample_firebase_app\android\app  </p>
  
  <p>The firebase site then suggests adding the following to the Project-level build.gradle (/build.gradle):</p>
  
  <pre><code>buildscript {
    dependencies {
      // Add this line
      classpath 'com.google.gms:google-services:4.0.1'
    }
  }
  </code></pre>
  
  <p>But there is no such path, so I put it in
  D:\Flutter\SampleFirebaseApplication\sample_firebase_app\android\build.gradle</p>
  
  <p>The firebase site then suggests to put the text below into 
  App-level build.gradle (//build.gradle):</p>
  
  <pre><code>dependencies {
    // Add this line
    implementation 'com.google.firebase:firebase-core:16.0.1'
  }
  ...
  // Add to the bottom of the file
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p>However there is path corresponding to this so I put it in</p>
  
  <p>D:\Flutter\SampleFirebaseApplication\sample_firebase_app\android\app\build.gradle</p>
  
  <p>It then suggests to sync by : "Finally, press "Sync now" in the bar that appears in the IDE:"
   No such message appears, so I right click the gradle files and select sync</p>
  
  <p>I see an error 
   Assertion failed: Write access is allowed inside write-action only (see com.intellij.openapi.application.Application.runWriteAction())</p>
  
  <p>But eventually the app runs but the firebase webpage is stuck at:<br>
  Run your app to verify installation:<br>
  Checking if the app has communicated with our servers. You may need to uninstall and reinstall your app.  </p>
  
  <p>After a lifetime of waiting I hit: Skip this step</p>
  
  <p>I uninstall and try again
   Same Result</p>
  
  <p>Approach Number two<br>
   I select Tools->firebaseThe assistant pops up<br>
   I select:  Set up firebase cloud messaging<br>
   I am greeted with:<br>
   Firebase Cloud Messaging lets you receive and send messages from your app to the server and other clients. This tutorial explains how to set up FCM and enable your app to receive notifications.<br>
   I select the first option:<br>
   Connect to Firebase<br>
   I am greeted with:<br>
   Could not find the Android Application module. Only Android Application Modules can be connected to Firebase online projects. Create a new Android Application Module or create/import a different Android Studio project.</p>
  
  <p>I have tried numerous other approaches, followed tutorials and spent many hours on this and have made no progress, any suggestions our ideas are welcome.</p>
  
  <p>I have tried this in a regular Android app and all works as expected, so the issue seems to be associated with Flutter Apps only. 
  Perhaps this is what the message:
  'Could not find the Android Application module. Only Android Application Modules can be connected to Firebase online projects. Create a new Android Application Module or create/import a different Android Studio project.'
  means, perhaps currently Firebase does not work with Flutter Apps.</p>