sparkfabrik / android-build-action

Build Android project, export .apk, optional upload to BrowserStack App Live.
MIT License
122 stars 21 forks source link

Build app failed because of new version of `bundler` #12

Closed misaert closed 1 year ago

misaert commented 1 year ago

Hi,

I tried to build our app this morning but the GitHub Action has failed.

I had some errors like that:

Retrying download gem from https://rubygems.org/ due to error (2/4): Bundler::PermissionError There was an error while trying to write to `/var/lib/gems/3.0.0/cache/http-accept-1.7.0.gem`. It is likely that you need to grant write permissions for that path.

Then these errors at the end:

In Gemfile:
  fastlane-plugin-increment_version_code
[08:34:09]: fastlane detected a Gemfile in the current directory
[08:34:09]: However, it seems like you didn't use `bundle exec`
[08:34:09]: To launch fastlane faster, please use
[08:34:09]: 
[08:34:09]: $ bundle exec fastlane android bundle
[08:34:09]: 
[08:34:09]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
[08:34:12]: Installing Ruby gem 'fastlane-plugin-browserstack'...
[08:34:13]: Error loading plugin 'fastlane-plugin-browserstack': You don't have write permissions for the /var/lib/gems/3.0.0 directory.
[08:34:13]: Installing Ruby gem 'fastlane-plugin-increment_version_code'...
[08:34:14]: Error loading plugin 'fastlane-plugin-increment_version_code': You don't have write permissions for the /var/lib/gems/3.0.0 directory.
[08:34:14]: It seems like you wanted to load some plugins, however they couldn't be loaded
[08:34:14]: Please follow the troubleshooting guide: https://docs.fastlane.tools/plugins/plugins-troubleshooting/
+----------------------------------------+-----------+------------------+
|                             Used plugins                              |
+----------------------------------------+-----------+------------------+
| Plugin                                 | Version   | Action           |
+----------------------------------------+-----------+------------------+
| fastlane-plugin-browserstack           | undefined | No actions found |
| fastlane-plugin-increment_version_code | undefined | No actions found |
+----------------------------------------+-----------+------------------+

[!] No actions were found while loading one or more plugins
    Please use `bundle exec fastlane` with plugins
    More info - https://docs.fastlane.tools/plugins/using-plugins/#run-with-plugins

[08:34:14]: Sending anonymous analytics information
[08:34:14]: Learn more at https://docs.fastlane.tools/#metrics
[08:34:14]: No personal or sensitive data is sent.
[08:34:14]: You can disable this by adding `opt_out_usage` at the top of your Fastfile
[08:34:14]: ------------------------------
[08:34:14]: --- Step: default_platform ---
[08:34:14]: ------------------------------
[08:34:14]: Driving the lane 'android bundle' 🚀
[08:34:14]: ---------------------------------------------
[08:34:14]: --- Step: google_play_track_version_codes ---
[08:34:14]: ---------------------------------------------
[08:34:15]: Found '17' version codes in track 'internal'
+------------------+----------------+
|           Lane Context            |
+------------------+----------------+
| DEFAULT_PLATFORM | android        |
| PLATFORM_NAME    | android        |
| LANE_NAME        | android bundle |
+------------------+----------------+
[08:34:15]: Plugin 'increment_version_code' was not properly loaded, make sure to follow the plugin docs for troubleshooting: https://docs.fastlane.tools/plugins/plugins-troubleshooting/

+------+---------------------------------+-------------+
|                   fastlane summary                   |
+------+---------------------------------+-------------+
| Step | Action                          | Time (in s) |
+------+---------------------------------+-------------+
| 1    | default_platform                | 0           |
| 2    | google_play_track_version_codes | 1           |
+------+---------------------------------+-------------+

Looking for related GitHub issues on fastlane/fastlane...

➡️  java.lang.IllegalArgumentException: Unknown package:
    https://github.com/fastlane/fastlane/issues/1[852](https://github.com/geonativefr/my-project/actions/runs/123/jobs/456#step:7:853)7 [closed] 4 💬
    19 Aug 2021

➡️  snapshot works locally, but not on CircleCI
    https://github.com/fastlane/fastlane/issues/17193 [closed] 10 💬
    25 Dec 2020

➡️  version.rb Malformed version number string undefined (ArgumentError)
    https://github.com/fastlane/fastlane/issues/15715 [closed] 4 💬
    28 Jan 2020

and 3 more at: [https://github.com/fastlane/fastlane/search?q=Malformed%20version%20number%20string%20undefined&type=Issues&utf8=✓](https://github.com/fastlane/fastlane/search?q=Malformed%20version%20number%20string%20undefined&type=Issues&utf8=%E2%9C%93)

/usr/lib/ruby/vendor_ruby/rubygems/version.rb:216:in `initialize': Malformed version number string undefined (ArgumentError)
    from /usr/lib/ruby/vendor_ruby/rubygems/version.rb:207:in `new'
    from /usr/lib/ruby/vendor_ruby/rubygems/version.rb:207:in `new'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/plugins/plugin_update_manager.rb:29:in `block in show_update_status'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/plugins/plugin_update_manager.rb:26:in `each'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/plugins/plugin_update_manager.rb:26:in `show_update_status'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/commands_generator.rb:45:in `ensure in start'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/commands_generator.rb:55:in `start'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/bin/fastlane:23:in `<top (required)>'
    from /usr/local/bin/fastlane:25:in `load'
    from /usr/local/bin/fastlane:25:in `<main>'
/usr/lib/ruby/vendor_ruby/rubygems/version.rb:216:in `initialize': \e[31m[!] Malformed version number string undefined\e[0m (ArgumentError)
    from /usr/lib/ruby/vendor_ruby/rubygems/version.rb:207:in `new'
    from /usr/lib/ruby/vendor_ruby/rubygems/version.rb:207:in `new'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/plugins/plugin_update_manager.rb:29:in `block in show_update_status'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/plugins/plugin_update_manager.rb:26:in `each'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/plugins/plugin_update_manager.rb:26:in `show_update_status'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/lane_manager_base.rb:20:in `finish_fastlane'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/lane_manager.rb:67:in `cruise_lane'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/commands_generator.rb:110:in `block (2 levels) in run'
    from /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
    from /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
    from /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'
    from /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/commands_generator.rb:354:in `run'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/commands_generator.rb:43:in `start'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/bin/fastlane:23:in `<top (required)>'
    from /usr/local/bin/fastlane:25:in `load'
    from /usr/local/bin/fastlane:25:in `<main>'
/usr/lib/ruby/vendor_ruby/rubygems/version.rb:216:in `initialize': Malformed version number string undefined (ArgumentError)
    from /usr/lib/ruby/vendor_ruby/rubygems/version.rb:207:in `new'
    from /usr/lib/ruby/vendor_ruby/rubygems/version.rb:207:in `new'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/plugins/plugin_update_manager.rb:29:in `block in show_update_status'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/plugins/plugin_update_manager.rb:26:in `each'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/plugins/plugin_update_manager.rb:26:in `show_update_status'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/lane_manager_base.rb:20:in `finish_fastlane'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/lane_manager.rb:67:in `cruise_lane'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/commands_generator.rb:110:in `block (2 levels) in run'
    from /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
    from /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
    from /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'
    from /var/lib/gems/3.0.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/commands_generator.rb:354:in `run'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/commands_generator.rb:43:in `start'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off'
    from /var/lib/gems/3.0.0/gems/fastlane-2.211.0/bin/fastlane:23:in `<top (required)>'
    from /usr/local/bin/fastlane:25:in `load'
    from /usr/local/bin/fastlane:25:in `<main>'
Error: The process '/usr/bin/bash' failed with exit code 1

So the app doesn't build.

I searched why and I noticed the version of bundler (gem package used here) has been updated from 2.3.26 to 2.4.1. (see changelog)

I forked this repository to define the version (see here) and it works with this change.

Do you know why?

Thanks,

Mickaël

tachibana-shin commented 1 year ago

I'm in the same condition. It's only recently appeared.

tachibana-shin commented 1 year ago

I think the new version of a dependency package has given up its own right so it leads to an error

I'm in the same condition. It's only recently appeared.

skylersaleh commented 1 year ago

I'm also running into this issue.

EmilianoMorghen commented 1 year ago

Hey there, we've published a new release. Now you can specify both Ruby and bundler versions in your workflow.

For more info checkout the release change log.

misaert commented 1 year ago

Oh great! Thank you!

We can test this new release for the next deployment of our app. I will close this issue after it.

I'll keep in touch!

Mickaël

misaert commented 1 year ago

Hi,

No issue anymore with the version 1.5.0 :tada: (see #23)

Thanks,

Mickaël