Closed DanPetras closed 5 months ago
@DanPetras - Have you tried the latest dev version? This contains the gradle fix I believe. The dev release will be general release at some point in the new year.
dart pub global activate flutterfire_cli 0.3.0-dev.19 --overwrite
I'll try in couple of days, thanks for the info.
@russellwheatley I did run ~/.pub-cache/bin/flutterfire configure
but it did not update the gradle files.
Output of ~/.pub-cache/bin/flutterfire --version
is 0.3.0-dev.19
.
It did add upload crashlytics symbols to iOS but Android gradle files are unchanged.
I also ran flutterfire reconfigure
but with the same result.
Here are attached my current gradle files. (I'm using gradle 8.3 if that matters) gradle_files.zip
It seems to me you've edited your build.gradle files from default flutter create .
. You need
android/build.gradle
to have the following dependencies
script:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
See if it changes now and let me know. Thanks.
You are right, I just went ahead and used newer syntax not yet used by flutter create
in version 3.16.
After rolling the change back, the flutterfire updated both build.gradle files 👍
It seems that future (next?) release of flutter will also use this new syntax (see https://github.com/flutter/flutter/issues/135392 Flutter master section) in that case the change will need to be applied also to settings.gradle
file as I proposed in the first entry.
Thanks for the heads up, @DanPetras. I will get this updated ahead of the proposed changes 👍
Is there an existing issue for this?
CLI Version
0.2.7
Firebase Tools version
13.0.1
Flutter Doctor Output
[✓] Flutter (Channel stable, 3.16.3, on macOS 14.2.1 23C71 darwin-arm64, locale en-SK) • Flutter version 3.16.3 on channel stable at /Applications/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision b0366e0a3f (2 weeks ago), 2023-12-05 19:46:39 -0800 • Engine revision 54a7145303 • Dart version 3.2.3 • DevTools version 2.28.4
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/***/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15A507 • CocoaPods version 1.14.3
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
[✓] IntelliJ IDEA Community Edition (version 2023.1.3) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.85.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.78.0
[✓] Connected device (3 available) • macOS (desktop) • macos • darwin-arm64 • macOS 14.2.1 23C71 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.109
[✓] Network resources • All expected network resources are available.
• No issues found!
Description
The default flutter project structure for Android changed from the previous format. The CLI doesn't change the gradle files when running the configure command. I would expect CLI to at least generate warning / error when it can't add the required plugins.
I added comments where I'd expect CLI to add required plugins.
Also worth noting is that in default project created in Android Studio, the
plugins { id "some.plugin" version "x.y.z" apply false ... }
is located in the top module build.gradle file but flutter puts it in the settings.gradle, so it seems that it can work in both locations.Top module build.gradle file:
app module build.gradle file:
settings.gradle file:
Steps to reproduce
Expected behavior
Gradle files are updated, adding required google-services / firebase plugins.
Screenshots
No response
Additional context and comments
No response