firebase / fastlane-plugin-firebase_app_distribution

fastlane plugin for Firebase App Distribution. https://firebase.google.com/docs/app-distribution
MIT License
166 stars 27 forks source link

Issues with googleservice_info_plist_path parameter #220

Closed gmogames closed 2 years ago

gmogames commented 3 years ago

Issue Description

I cannot get googleservice_info_plist_path to work when using firebase_app_distribution on it's own lane. I have lanes for provisioning, building and deploying separate and they are called at different times, thus not having a shared lane value for the Xcode archive location, so it doesn't matter what value I put into the plist path, the plugin will always fail to get the app id as it uses the shared lane values to get the archived path, and in my case it's always null.

Would be awesome if we could just pass the full path of the .app or for the actual plist file without depending on the archive path being there.

Configuration
    firebase_app_distribution(
      googleservice_info_plist_path: "GoogleService-Info.plist",
      service_credentials_file: "fastlane/credentials.json",
      ipa_path: options[:ipa],
      testers_file: "fastlane/testers.txt",
      debug: true
    )
Complete verbose output
Verbose Output gmo@A0792-MS-GM app_dir % bundle exec fastlane deploy to:enterprise ipa:./build/app_staging.ipa [βœ”] πŸš€ +-------------------------------------------+---------+-----------------------------------------------------------+ | Used plugins | +-------------------------------------------+---------+-----------------------------------------------------------+ | Plugin | Version | Action | +-------------------------------------------+---------+-----------------------------------------------------------+ | fastlane-plugin-aws_s3 | 2.0.2 | aws_s3 | | fastlane-plugin-xcconfig_actions | 1.4.2 | build_settings_to_flags, read_xcconfig, validate_xcconfig | | fastlane-plugin-xcconfig | 2.0.0 | update_xcconfig_value, set_xcconfig_value, | | | | get_xcconfig_value | | fastlane-plugin-firebase_app_distribution | 0.2.9 | firebase_app_distribution_login, | | | | firebase_app_distribution_get_udids, | | | | firebase_app_distribution | +-------------------------------------------+---------+-----------------------------------------------------------+ [19:15:45]: ------------------------------ [19:15:45]: --- Step: default_platform --- [19:15:45]: ------------------------------ [19:15:45]: Driving the lane 'ios deploy' πŸš€ [19:15:45]: ----------------------------- [19:15:45]: --- Step: setup_circle_ci --- [19:15:45]: ----------------------------- [19:15:45]: Not running on CI, skipping CI setup [19:15:45]: ipa: ./build/app_staging.ipa [19:15:45]: dsym: output/gym/app_staging.app.dSYM.zip [19:15:45]: --------------------------------------------------- [19:15:45]: --- Step: Switch to ios deploy_to_firebase lane --- [19:15:45]: --------------------------------------------------- [19:15:45]: Cruising over to lane 'ios deploy_to_firebase' πŸš– [19:15:45]: path: <<<<<<< path empty as SharedValues::XCODEBUILD_ARCHIVE is not present [19:15:45]: --------------------------------------- [19:15:45]: --- Step: firebase_app_distribution --- [19:15:45]: --------------------------------------- [19:15:45]: ------------------- [19:15:45]: --- Step: is_ci --- [19:15:45]: ------------------- +------------------+------------+ | Lane Context | +------------------+------------+ | DEFAULT_PLATFORM | ios | | PLATFORM_NAME | ios | | LANE_NAME | ios deploy | +------------------+------------+ [19:15:45]: Missing app id. Please check that the app parameter is set and try again +------+---------------------------------------+-------------+ | fastlane summary | +------+---------------------------------------+-------------+ | Step | Action | Time (in s) | +------+---------------------------------------+-------------+ | 1 | default_platform | 0 | | 2 | setup_circle_ci | 0 | | 3 | Switch to ios deploy_to_firebase lane | 0 | | πŸ’₯ | firebase_app_distribution | 0 | | 5 | is_ci | 0 | +------+---------------------------------------+-------------+ [19:15:45]: fastlane finished with errors Looking for related GitHub issues on fastlane/fastlane... ➑️ DELIVER (2.150.0.rc3/4) always ask attribute whatsNew https://github.com/fastlane/fastlane/issues/16700 [open] 91 πŸ’¬ a day ago ➑️ [iTunes Transporter]: Read Timed Out - unable to upload app to TestFlight https://github.com/fastlane/fastlane/issues/16892 [open] 60 πŸ’¬ 2 days ago ➑️ Fastlane produce fails with error, but appears to still create the app on App Store Connect https://github.com/fastlane/fastlane/issues/18794 [closed] 8 πŸ’¬ 5 weeks ago and 117 more at: https://github.com/fastlane/fastlane/search?q=Missing%20app%20id.%20Please%20check%20that%20the%20app%20parameter%20is%20set%20and%20try%20again&type=Issues&utf8=βœ“ πŸ”— You can ⌘ + double-click on links to open them directly in your browser. Traceback (most recent call last): 36: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/bin/ruby_executable_hooks:22:in `
' 35: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/bin/ruby_executable_hooks:22:in `eval' 34: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/bin/fastlane:23:in `
' 33: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/bin/fastlane:23:in `load' 32: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/bin/fastlane:23:in `' 31: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in `take_off' 30: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/commands_generator.rb:42:in `start' 29: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/commands_generator.rb:353:in `run' 28: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!' 27: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:76:in `run!' 26: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command' 25: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run' 24: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call' 23: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/commands_generator.rb:109:in `block (2 levels) in run' 22: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle' 21: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane' 20: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/runner.rb:45:in `execute' 19: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/runner.rb:45:in `chdir' 18: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute' 17: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/lane.rb:33:in `call' 16: from Fastfile:167:in `block (2 levels) in parsing_binding' 15: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing' 14: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/runner.rb:146:in `trigger_action_by_name' 13: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/runner.rb:204:in `try_switch_to_lane' 12: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/lane.rb:33:in `call' 11: from Fastfile:181:in `block (2 levels) in parsing_binding' 10: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing' 9: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name' 8: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action' 7: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/runner.rb:229:in `chdir' 6: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action' 5: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action' 4: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action' 3: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-firebase_app_distribution-0.2.9/lib/fastlane/plugin/firebase_app_distribution/actions/firebase_app_distribution_action.rb:21:in `run' 2: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-plugin-firebase_app_distribution-0.2.9/lib/fastlane/plugin/firebase_app_distribution/actions/firebase_app_distribution_action.rb:82:in `app_id_from_params' 1: from /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane_core/lib/fastlane_core/ui/ui.rb:17:in `method_missing' /Users/gmo/Apps/app_dir/vendor/bundle/ruby/2.7.0/gems/fastlane-2.191.0/fastlane_core/lib/fastlane_core/ui/interface.rb:129:in `crash!': \e[31m[!] Missing app id. Please check that the app parameter is set and try again\e[0m (FastlaneCore::Interface::FastlaneCrash)
Environment
Library Version
fastlane 2.191.0
fastlane-plugin-firebase_app_distribution 0.2.9
rachaprince commented 2 years ago

Hey @gmogames! Apologies for the delayed response.

Right now, I think the best workaround is use the app parameter to specify the app id instead of the googleservice_info_plist_path. I'll raise your request to be able to pass the full path of the .app or the actual plist file to the team.

Thanks!

rachaprince commented 2 years ago

I'm going to close this issue for now, but please fill out a Firebase feature request (https://firebase.google.com/support/troubleshooter/report/features) if you are still interested in this functionality!

vassily-fr commented 5 months ago

Hi, I came up with a simple solution using other Fastlane command line :

appID = get_info_plist_value(path: "./#{GEN_DIR}/../MyApplication/Configuration/GoogleService-Info.plist", key: "GOOGLE_APP_ID")

ipa_file_name = "#{file_name}.ipa"
dsym_file_name = "#{file_name}.app.dSYM.zip"   

 appID = get_info_plist_value(path: "./#{GEN_DIR}/../MyApplication/Configuration/GoogleService-Info.plist", key: "GOOGLE_APP_ID")

  release = firebase_app_distribution(
      app: "#{appID}",
      testers: "truc@truc.com",
      release_notes: "#{RELEASE_NOTE_CONTENT}",
      ipa_path: "./#{GEN_DIR}/#{ipa_file_name}"
  )

  upload_symbols_to_crashlytics(dsym_path: "./#{GEN_DIR}/#{dsym_file_name}",  gsp_path: "./#{GEN_DIR}/../MyApplication/Configuration/GoogleService-Info.plist", binary_path: "./#{GEN_DIR}/../Pods/FirebaseCrashlytics/upload-symbols")