Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Running flutterfire configure changes values in project.pbxproj each time #272

Open
1 task done
OutdatedGuy opened this issue Mar 31, 2024 · 7 comments
Open
1 task done
Labels
enhancement New feature or request keep open Needs Attention OP created or responded to issue and it needs attention.

Comments

@OutdatedGuy
Copy link
Contributor

OutdatedGuy commented Mar 31, 2024

Is there an existing issue for this?

  • 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

  1. Create a flutter project with ios platform
  2. Initialize with git and make a temporary commit (To later see changes)
  3. Run flutterfire configure --project={{project_name}} --platforms="ios" -y; command
  4. Commit these changes (To ignore the extra added files if any during comparison)
  5. Repeat step 3
  6. Stage the ios/Runner.xcodeproj/project.pbxproj file.
  7. Repeat step 3
  8. 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

@OutdatedGuy OutdatedGuy added bug Something isn't working triage labels Mar 31, 2024
@russellwheatley
Copy link
Member

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.

@OutdatedGuy
Copy link
Contributor Author

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.

@russellwheatley russellwheatley added enhancement New feature or request and removed bug Something isn't working triage labels Apr 5, 2024
@Wackymax
Copy link

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?

@Wackymax
Copy link

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
}

@SelaseKay SelaseKay added the Needs Attention OP created or responded to issue and it needs attention. label Sep 19, 2024
Copy link

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

@github-actions github-actions bot added the Stale label Oct 17, 2024
@OutdatedGuy
Copy link
Contributor Author

@russellwheatley any updates on this?

It's still present in the latest version and gets super annoying to revert those specific lines each time configure command is ran.

@github-actions github-actions bot removed the Stale label Oct 17, 2024
Copy link

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request keep open Needs Attention OP created or responded to issue and it needs attention.
Projects
None yet
Development

No branches or pull requests

4 participants