Home > Back-end >  Having problems with firebase in flutter
Having problems with firebase in flutter

Time:10-27

I'm havings problems with installing firebase in a flutter app

So I´m new to flutter and tried create a login page using firebase and followed the example in the firebase website where it says that you need to add this code

plugins {
  id 'com.android.application'

  // Add the Google services Gradle plugin
  id 'com.google.gms.google-services'

  ...
}

to the build.gradle file, but when i do this and try to run my flutter app through android studio, it stops in the "Gradle task assembleDebug" part and prints out in the terminal: "Build failed with an exception" and only buildscript {}, pluginManagement {} and other plugins {} script blocks are allowed before plugins {} blocks, no other statements are allowed

Can someone help please, thanks

CodePudding user response:

remove that plugins and change it with this

apply plugin: 'com.android.application'
// START: FlutterFire Configuration
apply plugin: 'com.google.gms.google-services'
// END: FlutterFire Configuration

  • Related