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 loading plugin 'fastlane-plugin-firebase_app_distribution': cannot load such file -- fastlane/plugin/firebase_app_distribution #43

Closed hbanzon closed 3 years ago

hbanzon commented 4 years ago

Since installing the plugin, I've needed to root access to use fastlane. However, I can't do that because cocoapods cannot be run as root. Please advise.

Steps to reproduce

Run the build

Output

Hinos-MacBook-Pro:ios hino$ bundle exec fastlane adhoc
[✔] 🚀 
[15:52:58]: Error loading plugin 'fastlane-plugin-firebase_app_distribution': cannot load such file -- fastlane/plugin/firebase_app_distribution
[15:52:58]: It seems like you wanted to load some plugins, however they couldn't be loaded
[15:52:58]: Please follow the troubleshooting guide: https://docs.fastlane.tools/plugins/plugins-troubleshooting/
....

My Environment

fastlane env

<details><summary>✅ fastlane environment ✅</summary>

### Stack

| Key                         | Value                                                          |
| --------------------------- | -------------------------------------------------------------- |
| OS                          | 10.15.3                                                        |
| Ruby                        | 2.6.3                                                          |
| Bundler?                    | false                                                          |
| Git                         | git version 2.21.1 (Apple Git-122.3)                           |
| Installation Source         | /usr/local/bin/fastlane                                        |
| Host                        | Mac OS X 10.15.3 (19D76)                                       |
| Ruby Lib Dir                | /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib |
| OpenSSL Version             | LibreSSL 2.8.3                                                 |
| Is contained                | false                                                          |
| Is homebrew                 | false                                                          |
| Is installed via Fabric.app | false                                                          |
| Xcode Path                  | /Applications/Xcode.app/Contents/Developer/                    |
| Xcode Version               | 11.3.1                                                         |

### System Locale

| Variable | Value       |   |
| -------- | ----------- | - |
| LANG     | en_US.UTF-8 | ✅ |
| LC_ALL   |             |   |
| LANGUAGE |             |   |

### fastlane files:

<details><summary>`./fastlane/Fastfile`</summary>

```ruby
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform :ios

platform :ios do
  before_all do
    setup_circle_ci
  end

  desc "QA Build"
  lane :qa do
    cocoapods()
    match(type: "development", readonly: true)
    match(type: "adhoc", readonly: true)
    gym(export_method: "ad-hoc",
        workspace: "abc.xcworkspace",
        scheme: "abc-qa",
        clean: true)
  end

  desc "Upload AdHoc Build to App Distribution"
  lane :adhoc_distribute do
    firebase_app_distribution(app: "myFirebaseAppID",
                              ipa_path: "output/gym/abc.ipa",
                              groups: "group",
                              debug: true)
  end

end

`./fastlane/Appfile` ```ruby ... # For more information about the Appfile, see: # https://docs.fastlane.tools/advanced/#appfile ```

fastlane gems

Gem Version Update-Status
fastlane 2.144.0 ✅ Up-To-Date

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-firebase_app_distribution undefined 💥 Check failed
Loaded gems | Gem | Version | | ----------------------------------------- | ------------ | | did_you_mean | 1.3.0 | | slack-notifier | 2.3.2 | | rouge | 2.0.7 | | xcpretty | 0.3.0 | | terminal-notifier | 2.0.0 | | terminal-table | 1.8.0 | | plist | 3.5.0 | | public_suffix | 2.0.5 | | addressable | 2.7.0 | | multipart-post | 2.0.0 | | word_wrap | 1.0.0 | | babosa | 1.0.3 | | colored | 1.2 | | highline | 1.7.10 | | commander-fastlane | 4.4.6 | | unf_ext | 0.0.7.6 | | unf | 0.1.4 | | domain_name | 0.5.20190701 | | http-cookie | 1.0.3 | | faraday-cookie_jar | 0.0.6 | | faraday_middleware | 0.13.1 | | fastimage | 2.1.7 | | gh_inspector | 1.1.3 | | multi_xml | 0.6.0 | | rubyzip | 1.3.0 | | security | 0.1.3 | | xcpretty-travis-formatter | 1.0.0 | | dotenv | 2.7.5 | | bundler | 2.0.2 | | jwt | 2.1.0 | | uber | 0.1.0 | | declarative | 0.0.10 | | declarative-option | 0.1.0 | | representable | 3.0.4 | | retriable | 3.1.2 | | mini_mime | 1.0.2 | | httpclient | 2.8.3 | | google-api-client | 0.36.4 | | emoji_regex | 1.0.1 | | jmespath | 1.4.0 | | aws-eventstream | 1.0.3 | | aws-sigv4 | 1.1.1 | | aws-sdk-core | 3.92.0 | | aws-sdk-kms | 1.30.0 | | aws-sdk-s3 | 1.61.1 | | nanaimo | 0.2.6 | | colored2 | 3.1.2 | | claide | 1.0.3 | | CFPropertyList | 3.0.2 | | atomos | 0.1.3 | | xcodeproj | 1.15.0 | | unicode-display_width | 1.7.0 | | tty-screen | 0.7.1 | | tty-cursor | 0.7.1 | | tty-spinner | 0.9.3 | | excon | 0.73.0 | | faraday | 0.17.3 | | json | 2.3.0 | | mini_magick | 4.10.1 | | naturally | 2.2.0 | | simctl | 1.6.8 | | multi_json | 1.14.1 | | signet | 0.13.0 | | os | 1.0.1 | | memoist | 0.16.2 | | googleauth | 0.11.0 | | digest-crc | 0.5.1 | | google-cloud-errors | 1.0.0 | | google-cloud-env | 1.3.1 | | google-cloud-core | 1.5.0 | | google-cloud-storage | 1.25.1 | | aws-partitions | 1.287.0 | | forwardable | 1.2.0 | | logger | 1.3.0 | | stringio | 0.0.2 | | ipaddr | 1.2.2 | | openssl | 2.1.2 | | ostruct | 0.1.0 | | strscan | 1.0.0 | | date | 2.0.0 | | fileutils | 1.1.0 | | etc | 1.0.1 | | io-console | 0.4.7 | | zlib | 1.0.0 | | libxml-ruby | 3.1.0 | | rexml | 3.1.9 | | psych | 3.1.0 | | mutex_m | 0.1.0 | | webrick | 1.4.2 | | fastlane-plugin-firebase_app_distribution | 0.1.4 |

generated on: 2020-03-26

TKBurner commented 4 years ago

Have you run:

fastlane add_plugin firebase_app_distribution

hbanzon commented 4 years ago

Hi @TKBurner!

Yes, I did. My apologies that I didn't specify that earlier.

stensmir commented 4 years ago

Hi @hbanzon!

sudo fastlane add_plugin firebase_app_distribution

Works for me, but not sure this right way

etasaka commented 4 years ago

@hbanzon

I did not have a problem setting up iOS, but for android I experienced the same problem as you. Installing the plugin using sudo only installed it, but when I went to run the lane it failed again. I found using one dot release earlier solves the problem.

gem 'fastlane-plugin-firebase_app_distribution', '0.1.3'

hbanzon commented 4 years ago

Looks like the 0.1.3 release solves this problem. Thank you @etasaka !

Is it possible that this is a bug introduced in 0.1.4? Or is it intended behavior? I do like to make sure my tooling is updated to latest and greatest as much as possible, so it would be good if I need to update my environment in certain ways to make use of this plugin. Bare in mind, I would trigger this command in a CI environment.

Much thanks!

~Hino

dan-ryan commented 4 years ago

Setting Ruby to 2.6 fixed this issue for me.

shinriyo commented 4 years ago
ruby --version                                                                                                                      Tue May  5 08:18:00 2020
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

cannot load such file -- fastlane/plugin/firebase_app_distribution

shinriyo commented 4 years ago

Ah. !!!! 0.1.4 is broken somehow.??? why didn't them test

akovalov commented 4 years ago

I had the same problem and it was due to a very outdated version of Ruby and RubyGems. Don't remember what I did exactly but here is some guidance.

  1. Make sure you have a latest Ruby version and update if needed via Homebrew or other
    ~$ ruby --version
    ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
    ~$ brew upgrade ruby
  2. Update RubyGems if needed
    ~$ sudo gem update
    // if it will say no permission run the following
    ~$ sudo gem update -n /usr/local/bin
    // optional, make a cleanup
    gem cleanup -n /usr/local/bin
  3. Update fastlane firebase_app_distribution plugin. Make sure fastlane/Pluginfile has a line gem 'fastlane-plugin-firebase_app_distribution' without version specified
    // go a project root folder
    ~$ bundle exec fastlane update_plugins 
    // also we can remove and add plugin 
    ~$ bundle exec fastlane remove_plugin firebase_app_distribution
    ~$ bundle exec fastlane install_plugins
    ~$ bundle exec fastlane update_plugins
    ~$ bundle exec fastlane add_plugin firebase_app_distribution
    // it can say that there is no permission, then add those permissions
    ~$ sudo chmod -R a+r /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-firebase_app_distribution-0.1.4
    ~$ bundle exec fastlane add_plugin firebase_app_distribution

Now it should work. However, maybe I missed to write something here, but the idea is to have everything up to date.

artur-zaremba commented 4 years ago

https://stackoverflow.com/a/61914727 Helped this one without installing additional ruby/rvm

obadasemary commented 4 years ago

yes I found the answer in some other closed issues

https://github.com/fastlane/fastlane-plugin-firebase_app_distribution/issues/15

you can find the solution there

https://github.com/fastlane/fastlane-plugin-firebase_app_distribution/issues/15#issuecomment-631478528

It looks like some kind of file permission issue under Catalina, so chmod might help. But you can also install fastlane-plugin-firebase_app_distribution in gem's USER INSTALLATION DIRECTORY (gem env will tell you where it is).

So, I uninstalled the gem from the default dir. sudo gem uninstall fastlane-plugin-firebase_app_distribution and then installed in user dir gem install fastlane-plugin-firebase_app_distribution --user-install

and now it works.

as @komorian said

sergiosilvajr commented 3 years ago

I have had to write 1 more command after @obadasemary commands. $ sudo chmod -R a+r /Library/Ruby/Gems/2.6.0/gems/fastlane-plugin-firebase_app_distribution-0.1.4 (found here)

then, it worked PS: using macos Big Sur here.

estani commented 2 years ago

I had the same problem, and I'm not sure I want fastlane messing up with the central ruby...

I used rbenv to install a non root ruby version, this is by far my preferred way of installing ruby by the way (or rvm or other version manager).

But is not straight forward... This is what I did:

sudo gem uninstall fastlane # clean the system ruby if required

# mac only example, better see rbenv own page
brew install rbenv ruby-build

# setup this shell
rbenv init

# setup your shell in general (zsh example, sets the path)
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init - zsh)"' >> ~/.zshrc

# install your desired version
rbenv install 2.7.6

#check
rbenv versions    # * system 2.7.6

# activate globally yours
rbenv global 2.7.6

# check (if it doesn't show the proper version, start a new console and try again.
ruby --version

# now you have a running local ruby without root permits requirement, you'll have to install fastlane again
gem install fastlane

# OR you can use the one in the project
bundle exec fastlane