flutterfire_cli
flutterfire_cli copied to clipboard
[bug]: Running `flutterfire configure` changes values in `project.pbxproj` each time
Is there an existing issue for this?
- [X] I have searched the existing issues.
CLI Version
0.3.0-dev.21
Firebase Tools version
13.6.0
Flutter Doctor Output
[✓] Flutter (Channel stable, 3.19.5, on macOS 14.3.1 23D60 darwin-arm64, locale en-IN)
• Flutter version 3.19.5 on channel stable at /Users/omphatak/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 300451adae (4 days ago), 2024-03-27 21:54:07 -0500
• Engine revision e76c956498
• Dart version 3.3.3
• DevTools version 2.31.1
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/omphatak/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.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15E204a
• CocoaPods version 1.15.2
[✓] 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)
[✓] VS Code (version 1.85.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.80.0
[✓] VS Code (version 1.88.0-insider)
• VS Code at /Applications/Visual Studio Code - Insiders.app/Contents
• Flutter extension version 3.84.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.3.1 23D60 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.87
[✓] Network resources
• All expected network resources are available.
• No issues found!
Description
Each time the flutterfire configure command is ran for ios platform, the upload-crashlytics-symbols and script changes in the ios/Runner.xcodeproj/project.pbxproj file.
Steps to reproduce
- Create a flutter project with ios platform
- Initialize with git and make a temporary commit (To later see changes)
- Run
flutterfire configure --project={{project_name}} --platforms="ios" -y;command - Commit these changes (To ignore the extra added files if any during comparison)
- Repeat step 3
- Stage the
ios/Runner.xcodeproj/project.pbxprojfile. - Repeat step 3
- See there are changes in staged and current file.
Expected behavior
The script should change the values in ios/Runner.xcodeproj/project.pbxproj file each time the command is ran.
Screenshots
No response
Additional context and comments
No response
Yes, that's because we rewrite that script each time. We do it because we want to be sure that if there are any updates to that script (i.e changes to the flutterfire upload symbol function call), it will defacto update it.
Ok, but it's very annoying that it changes the content without actually having any difference in the upload symbols script.
If you re-write the script each time, can you first check the current script contents and only update if there is a difference.
Else, anytime I run that script (changing from dev to prod to staging, etc.), I manually have to check if there is any difference in the script. If there is I have to commit those changes or else discard if they are same.
Because I cannot always add those changes into commit unnecessarily.
Hi have a similar problem. I run flutterfire configure on our build server to load the production firebase details but it doesn't do it correctly on the Android side and adds in duplicate plugin entries for 'com.google.gms.google-services' causing my project to fail in the build set with the error message "Plugin with id 'com.google.gms.google-services' was already requested at line 4".
I think if you are going to rewrite entries at least rewrite it in an idempotent manner?
Hi have a similar problem. I run flutterfire configure on our build server to load the production firebase details but it doesn't do it correctly on the Android side and adds in duplicate plugin entries for 'com.google.gms.google-services' causing my project to fail in the build set with the error message "Plugin with id 'com.google.gms.google-services' was already requested at line 4".
I think if you are going to rewrite entries at least rewrite it in an idempotent manner?
This is what it generates on the second run:
plugins {
id "com.android.application"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
// END: FlutterFire Configuration
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
// END: FlutterFire Configuration
}