invertase / flutterfire_cli

A CLI to help with using FlutterFire in your Flutter applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug]: PhaseScriptExecution FlutterFire: flutterfire upload-crashlytics-symbols fails when archive app on XcodeBuild

michaelsoliman1 opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues.

CLI Version

0.3.0-dev.18

Firebase Tools version

12.5.4

Flutter Doctor Output

[✓] Flutter (Channel stable, 3.10.6, on macOS 13.4.1 22F770820d darwin-arm64, locale en-EG)
• Flutter version 3.10.6 on channel stable at /Users/michael/Dev/Flutter/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f468f3366c (9 weeks ago), 2023-07-12 15:19:05 -0700
• Engine revision cdbeda788a
• Dart version 3.0.6
• DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/michael/Library/Android/sdk
• Platform android-33, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E300c
• CocoaPods version 1.12.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
• 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 11.0.13+0-b1751.21-8125866)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
• IntelliJ at /Applications/IntelliJ IDEA.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.82.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.72.0

[✓] Connected device (3 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 13 (API 33) (emulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.4.1 22F770820d darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 116.0.5845.187

[✓] Network resources
• All expected network resources are available.

• No issues found!

Description

The exception only happens on Xcode Build, when I archive the app locally it works, I reconfigured all project (i use multiple flavors) and generated firebase.json file.

note: after updating to 0.3.18 i had to activate flutterfire in ci_post_clone.sh (below)

PhaseScriptExecution FlutterFire:\ \"flutterfire\ upload-crashlytics-symbols\" /Volumes/workspace/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/staging/IntermediateBuildFilesPath/Runner.build/Release-staging-iphoneos/Runner.build/Script-1C565E0404ECB51EC9F2AC70.sh (in target 'Runner' from project 'Runner')
    cd /Volumes/workspace/repository/apps/my-app/ios
    /bin/sh -c /Volumes/workspace/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/staging/IntermediateBuildFilesPath/Runner.build/Release-staging-iphoneos/Runner.build/Script-1C565E0404ECB51EC9F2AC70.sh

Unhandled exception:
Exception: 
#0      UploadCrashlyticsSymbols.run (package:flutterfire_cli/src/commands/upload_symbols.dart:315:7)
<asynchronous suspension>
#1      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#2      main (file:///Users/local/.pub-cache/hosted/pub.dev/flutterfire_cli-0.3.0-dev.18/bin/flutterfire.dart:63:5)
<asynchronous suspension>
Command PhaseScriptExecution failed with a nonzero exit code

firebase.json

{
    "flutter": {
        "platforms": {
            "android": {
                "buildConfigurations": {
                    "src/staging": {
                        "projectId": "my-app-staging",
                        "appId": "1:4084..",
                        "fileOutput": "android/app/src/staging/google-services.json"
                    },
                    "src/production": {
                        "projectId": "my-app-8c6c6",
                        "appId": "1:5619..",
                        "fileOutput": "android/app/src/production/google-services.json"
                    },
                    "src/development": {
                        "projectId": "my-app-dev",
                        "appId": "1:1446..",
                        "fileOutput": "android/app/src/development/google-services.json"
                    }
                }
            },
            "ios": {
                "buildConfigurations": {
                    "Release-staging": {
                        "projectId": "my-app-staging",
                        "appId": "1:4084..",
                        "uploadDebugSymbols": true,
                        "fileOutput": "ios/config/staging/GoogleService-Info.plist"
                    },
                    "Release-production": {
                        "projectId": "my-app-8c6c6",
                        "appId": "1:5619..",
                        "uploadDebugSymbols": true,
                        "fileOutput": "ios/config/production/GoogleService-Info.plist"
                    },
                    "Release-development": {
                        "projectId": "my-app-dev",
                        "appId": "1:1446..",
                        "uploadDebugSymbols": true,
                        "fileOutput": "ios/config/development/GoogleService-Info.plist"
                    }
                }
            },
            "dart": {
                "lib/firebase_options_staging.dart": {
                    "projectId": "my-app-staging",
                    "configurations": {
                        "android": "1:4084..",
                        "ios": "1:4084.."
                    }
                },
                "lib/firebase_options_production.dart": {
                    "projectId": "my-app-8c6c6",
                    "configurations": {
                        "android": "1:5619..",
                        "ios": "1:5619.."
                    }
                },
                "lib/firebase_options_development.dart": {
                    "projectId": "my-app-dev",
                    "configurations": {
                        "android": "1:1446..",
                        "ios": "1:1446.."
                    }
                }
            }
        }
    }
}

ci_post_clone.sh

#!/bin/sh

# The default execution directory of this script is the ci_scripts directory.
cd $CI_WORKSPACE/apps/my-app # change working directory to the root of your cloned repo.

# Install Flutter using git.
git clone https://github.com/flutter/flutter.git --depth 1 -b 3.10.6 $HOME/flutter
export PATH="$PATH:$HOME/flutter/bin"

# Install Flutter artifacts for iOS (--ios), or macOS (--macos) platforms.
flutter precache --ios

# Install Flutter dependencies.
flutter pub get

# had to add this line
# Install FlutterFire cli
dart pub global activate flutterfire_cli 0.3.0-dev.18 --overwrite 

# Install CocoaPods using Homebrew.
HOMEBREW_NO_AUTO_UPDATE=1 # disable homebrew's automatic updates.
brew install cocoapods

# Install CocoaPods dependencies.
cd ios && pod install # run `pod install` in the `ios` directory.

exit 0

Steps to reproduce

1- Add firebase_crashlytics
2- Run flutterfire configure (will add Build PhaseScript FlutterFire: "flutterfire upload-crashlytics-symbols")
3- build app on Xcode Cloud

Expected behavior

archive succeed

Screenshots

No response

Additional context and comments

No response

The archive was running on latest macOS version (Sonoma 14) when i changed it to macOS Ventura it worked, so it's probably a problem with the macOS version. Closing this as macOS Sonoma 14 is not released yet

commented

I get the same error. I am also working on macOS 14 and cannot easily change back to an older version. Is this something that will be fixed in the near future? The Sonoma beta is released by now, does the flutterfire cli not support it?