invertase / flutterfire_cli

A CLI to help with using FlutterFire in your Flutter applications.
Apache License 2.0
164 stars 47 forks source link

[bug]: configure command not updating build.gradle files #126

Closed mrquentin closed 10 months ago

mrquentin commented 1 year ago

Is there an existing issue for this?

CLI Version

0.2.6+1

Firebase Tools version

11.15.0

Flutter Doctor Output

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.3.6, on Microsoft Windows [Version 10.0.22623.870], locale en-CA) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) [✓] Chrome - develop for the web [✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.3.6) [✓] Android Studio (version 2021.3) [✓] IntelliJ IDEA Ultimate Edition (version 2022.2) [✓] VS Code (version 1.72.2) [✓] Connected device (4 available) [✓] HTTP Host Availability

• No issues found!

Description

I am on a windows machine and created an flutter app. I then wanted to setup firebase for it so I ran flutterfire configure. After selecting the project and platform, the command successfully create the ios and android app in firebase but never updates the android/build.gradle nor the android/app/build.gradle.

Result: my app never starts as the firebase initialise app doesn't work.

Steps to reproduce

  1. Run flutter create reproduce_bug --org "com.test"
  2. Run cd reproduce_bug
  3. Run flutter pub add firebase_core (installed version is 2.1.1)
  4. Run flutterfire configure
  5. Select the firebase project
  6. Select platform android and ios

Expected behavior

The flutterfire configure command is expected to update the build.gradle file (android/build.gradle and android/app/build.gradle).

image cf : https://youtu.be/vtGCteFYs4M?t=12612

Screenshots

Here is the output i get from the flutterfire command which is different from the one seen in expected behaviour

image

Additional context and comments

No response

OutdatedGuy commented 1 year ago

Same behaviour is seen by me. On my windows machine, the flutterfire cli doesn't add necessary package needed code in the build.gradle file.

But on my macbook, the package required code is added to build.gradle file.

Package required code:

// START: FlutterFire Configuration
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.firebase.firebase-perf'
// END: FlutterFire Configuration

and

// START: FlutterFire Configuration
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
classpath 'com.google.firebase:perf-plugin:1.4.1'
// END: FlutterFire Configuration

My flutterfire_cli package version is 0.2.6+1

Hauglid commented 1 year ago

I'm getting the same behaviour on Mac.

anroswart commented 1 year ago

No setup happening in either of the build.gradle files for me when running flutterfire configure. I'm on version 0.2.7.

Hauglid commented 1 year ago

Is it possible to get an update on this issue?

M123-dev commented 11 months ago

Same here no native file is changed, not on Windows and not using WSL

bfritscher commented 10 months ago

No native file is changed on windows with flutter 3.13 default flutter create project :-(

russellwheatley commented 10 months ago

Could everyone confirm that this is only occurring on their windows machine? Thanks.

Hauglid commented 10 months ago

@russellwheatley Does not work on mac.

russellwheatley commented 10 months ago

@Hauglid - any chance you could provide the build.gradles you have (omitting anything sensitive but keep formatting the exact same)?

The dependencies portion is what I'm interested in seeing for android/build.gradle:

e.g.

    dependencies {
        classpath 'com.android.tools.build:gradle:7.2.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }

and for android/app/build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
alidev0 commented 8 months ago

New Project, same issue.

DanPetras commented 6 months ago

@alidev0 Is #251 related?

alidev0 commented 6 months ago

@alidev0 Is #251 related?

even before that flutterfire_cli did not properly put the necessary code lines when using a windows machine, but it was working on mac. Now it does not work on either, yes probably because of #251 .

alidev0 commented 6 months ago

@DanPetras i did it by using android studio for that and that refer to this: https://github.com/firebase/flutterfire/issues/11912 for a fix after.

russellwheatley commented 6 months ago

@alidev0 - use the dev release, it has the fix:

dart pub global activate flutterfire_cli 0.3.0-dev.19 --overwrite
easypku commented 2 months ago

Same happens to me on Mac. build.gradle files are not updated. I tried all of these version of flutterfire_cli with no success:

russellwheatley commented 2 months ago

@easypku - Use:

dart pub global activate flutterfire_cli 

to install latest.