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

Error: Could not find action, lane or variable 'firebase_app_distribution'. #89

Closed TimAlber closed 4 years ago

TimAlber commented 4 years ago

We have trouble installing

In our Android App this works fine. Only in iOS we encounter this error. After installing the firebase_app_distribution plugin and implementing it into a fastlane lane we always get the error: Could not find action, lane or variable 'firebase_app_distribution'.

If we execute bundle exec fastlane update_plugins after installing the Plugin we get [!] No plugins are installed back. Even trough on installing we got this Feedback:

bundle exec fastlane add_plugin firebase_app_distribution
[⠋] 🚀 [⠙] 🚀 [⠹] 🚀 [⠸] 🚀 [⠼] 🚀 [⠴] 🚀 [⠦] 🚀 [⠧] 🚀 [✔] 🚀 
[06:53:58]: It seems like you wanted to load some plugins, however they couldn't be loaded
[06:53:58]: Please follow the troubleshooting guide: https://docs.fastlane.tools/plugins/plugins-troubleshooting/
[06:53:58]: Sending anonymous analytics information
[06:53:58]: Learn more at https://docs.fastlane.tools/#metrics
[06:53:58]: No personal or sensitive data is sent.
[06:53:58]: You can disable this by adding `opt_out_usage` at the top of your Fastfile
[06:53:58]: Plugin 'fastlane-plugin-firebase_app_distribution' was added to './fastlane/Pluginfile'
[06:53:58]: Make sure to commit your Gemfile, Gemfile.lock and Pluginfile to version control
Installing plugin dependencies...
Successfully installed plugins

It does not matter whether we run this using a config.yml on CircleCI or locally. We always get this error. We tried diffrent aproaches like installing the plugin direckly on circleci and so on. What did we miss? Is there a bug in the plugin or what did we do wrong?

The Files: config.yml:

build_staging:
    macos:
      xcode: "11.4.1"
    steps:
      - checkout

      - restore_cache:
          key: 1-gems-{{ checksum "Gemfile.lock" }}
      - run: bundle check || bundle install --path vendor/bundle
      - save_cache:
          key: 1-gems-{{ checksum "Gemfile.lock" }}
          paths:
            - vendor/bundle

      - run:
          name: Install CocoaPods
          command: pod install

      - run:
          name: Install Brew
          command: brew update

      - run:
          name: Update Carthage
          command: carthage update

      - run:
          name: Install jFrog
          command: brew install jfrog-cli-go

      - run:
          name: Download Sketch WWW
          command: ./scripts/downloadSketchArtefact.sh

      - run:
          name: Install Plugins
          command: sudo bundle exec fastlane install_plugins

      - run:
          name: Install Firebase CLI
          command: curl -sL https://firebase.tools | bash

      - run: 
          name: Build and deploy on Testflight
          #command: bundle exec fastlane ios deploy_to_testflight --env master_adhoc #refresh_certificates:true use_temporary_keychain:true install_crashlytics refresh_dsyms_firebase
          command: sudo bundle exec fastlane stagingBuild
          environment:
            BUNDLE_PATH: vendor/bundle

      - store_artifacts:
          path: "/Users/distiller/project/fastlane_delivery/dev/adhoc/Wolke von syqlo.ipa"

      - save_cache:
          key: v1-gems-{{ checksum "Gemfile.lock" }}
          paths:
            - vendor/bundle

Fastfile line:

lane :stagingBuild do
    setup_circle_ci

    latest_testflight_build_number(
      version: "1.0",
      app_identifier: "com.syqlo.wolke", #we want to get the Version number of production app, not staging, cause its not in appstore!
      )
    increment_build_number({
      build_number: latest_testflight_build_number(
        version: "1.0",
        app_identifier: "com.syqlo.wolke", # .staging schould be added // we want to write the Version number to this Bundle identifier, but get the previous value from the production version
        ) + 1
    })

    increment_version_number(
      bump_type: "minor"
    )

    #as circleci uses the com.syqlo.wolke app identifier for unknown reasons, we force it to change it. 
    update_app_identifier(
      xcodeproj: "./Wolke.xcodeproj", # Optional path to xcodeproj, will use the first .xcodeproj if not set
      plist_path: "./Wolke/Info.plist", # Path to info plist file, relative to xcodeproj
      app_identifier: "com.syqlo.wolke.staging" # The App Identifier
    )

    match(
      readonly: true,
      type: "development",
      git_branch: "master",
      app_identifier: "com.syqlo.wolke.staging",
      team_id: "Bla Bla"
    )

    match(
      readonly: true,
      type: "appstore",
      git_branch: "master",
      app_identifier: "com.syqlo.wolke.staging",
      team_id: "Bla Bla"
    )

    update_code_signing_settings(
      use_automatic_signing: false,
      team_id: "Bla Bla",
      profile_name: "match Development com.syqlo.wolke.staging",
      path: "./Wolke.xcodeproj"
    )

    gym(
        workspace: "Wolke.xcworkspace",
        scheme: "Wolke_Staging", 
        output_name: "Wolke von syqlo.ipa",
      output_directory: "./project/fastlane_delivery/dev/adhoc/",
        clean: true,
          export_options:{
        method: "app-store",
        provisioningProfiles:{
          "com.syqlo.wolke.staging" => "match AppStore com.syqlo.wolke.staging",
          #"com.syqlo.wolke" => "match AppStore com.syqlo.wolke"
        }
          }
    )

    crashlytics(
      api_token: ENV["CRASHLYTICS_API_TOKEN_STAGING"],
      build_secret: ENV["CRASHLYTICS_BUILD_SECRET_STAGING"],
      crashlytics_path: "./Pods/Crashlytics/Crashlytics.framework/submit", # path to your Crashlytics submit binary.
      ipa_path: "./project/fastlane_delivery/dev/adhoc/Wolke von syqlo.ipa",
    )

    puts "Crashlytics completed successfully"

    # This uplaods the dsym file to crashlytics. This is only necessary in master build.
    upload_symbols_to_crashlytics(dsym_path: "./project/fastlane_delivery/dev/adhoc/Wolke von syqlo.app.dSYM.zip")
    puts "Upload Symbols to Crashlytics completed successfully"

    # testflight(
    #   skip_submission: true,
    #   skip_waiting_for_build_processing: true
    # )

    #commit = last_git_commit
    firebase_app_distribution(
      app: "Lorem Impsum you cant read this",
      testers: "test@mail.com",
      release_notes: "Hey Tester, this is the new Wolke Staging iOS App.", #"Hey Tester, this is the new Wolke Staging iOS App.\nCommit Message:" + commit[:message]+"\nBranch Name: "+ git_branch,
      firebase_cli_token: "1//09CM07x_nC10XCgYIARAAGAkSNwF-L9IrySDyBBAUEvu_qcamstC4vMR-wCSHxiK7Fp6iCcIoWIXkAYvbgmoZgRenc22fX2dlEhQ"
      #firebase_cli_path: "/absolute/path/to/firebase/cli/binary"
    )

    update_code_signing_settings(
      use_automatic_signing: true,
      team_id: "Bla Bla",
      path: "./Wolke.xcodeproj"
    )
  end
TimAlber commented 4 years ago

This is solved now. Got it to work using sudo

RajChanchal commented 3 years ago

didn't work even with sudo

rebehe commented 1 year ago

FYI @TimAlber, we found a refresh token in your post above. Consider removing it and revoking it if still applicable.