Open derTuca opened 1 year ago
Thanks for opening your first issue here!
Interesting, looks like the parser doesn't like isar_version
alias, but by just looking at it I'm not sure how that could happen... Let me find some time to repro this.
That's what struck me as well but the really weird fact is that the same file works on my Mac. I'll also try it on Windows when I get my hands on that.
Take all the time that you need, thanks!
Ok, the issue seems to be with the Ruby version. On the mac I had Ruby 2.6.10 and on Fedora I had Ruby 3.1.2. I've installed Ruby 3.1.2 on the Mac and it stopped working on there as well.
[EDIT] Ruby 3.1.4 and 3.2.2 also do not work.
Can confirm we have the same issue
But I do not think it is related to ruby version, as we have another version running version 3, without issues
@tianhaoz95 I've tried a few different things but it keeps failing
Also just tried downgrading with rbenv
to 2.6.10:
/Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-plugin-flutter_version-1.1.15/lib/fastlane/plugin/flutter_version/actions/flutter_version_action.rb:18:in `rescue in run': [!] Read pubspec.yaml failed (RuntimeError)
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-plugin-flutter_version-1.1.15/lib/fastlane/plugin/flutter_version/actions/flutter_version_action.rb:14:in `run'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
from Fastfile:10:in `get_version_name'
from Fastfile:55:in `block (2 levels) in parsing_binding'
from Fastfile:53:in `chdir'
from Fastfile:53:in `block in parsing_binding'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/lane.rb:41:in `call'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/lane_manager.rb:46:in `cruise_lane'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/command_line_handler.rb:34:in `handle'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/commands_generator.rb:110:in `block (2 levels) in run'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/commands_generator.rb:363:in `run'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/commands_generator.rb:43:in `start'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/bin/fastlane:23:in `<top (required)>'
from /Users/mf/.rbenv/versions/2.6.10/bin/fastlane:23:in `load'
from /Users/mf/.rbenv/versions/2.6.10/bin/fastlane:23:in `<main>'
/Users/mf/.rbenv/versions/2.6.10/lib/ruby/2.6.0/psych.rb:577:in `initialize': No such file or directory @ rb_sysopen - ../pubspec.yaml (Errno::ENOENT)
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/2.6.0/psych.rb:577:in `open'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/2.6.0/psych.rb:577:in `load_file'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-plugin-flutter_version-1.1.15/lib/fastlane/plugin/flutter_version/actions/flutter_version_action.rb:15:in `run'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:263:in `block (2 levels) in execute_action'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/actions/actions_helper.rb:69:in `execute_action'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:229:in `chdir'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:229:in `execute_action'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
from Fastfile:10:in `get_version_name'
from Fastfile:55:in `block (2 levels) in parsing_binding'
from Fastfile:53:in `chdir'
from Fastfile:53:in `block in parsing_binding'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/lane.rb:41:in `call'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/lane_manager.rb:46:in `cruise_lane'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/command_line_handler.rb:34:in `handle'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/commands_generator.rb:110:in `block (2 levels) in run'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/commands_generator.rb:363:in `run'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/commands_generator.rb:43:in `start'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off'
from /Users/mf/.rbenv/versions/2.6.10/lib/ruby/gems/2.6.0/gems/fastlane-2.220.0/bin/fastlane:23:in `<top (required)>'
from /Users/mf/.rbenv/versions/2.6.10/bin/fastlane:23:in `load'
from /Users/mf/.rbenv/versions/2.6.10/bin/fastlane:23:in `<main>'
Also uninstalled rbenv and tried installing fastlane with brew; same result unfortunately
What's interesting is, if I remove the build number from the version code in pubspec it fails with:
[!] Verson code indicator (+) not found in pubspec.yml (RuntimeError)
So it does indeed read from the file
In my case the reason was actually that inside Fastlane script I changed the working folder to be something else, so the default relative path ../pubspec.yaml
would no longer be valid.
But I found that it's possible to change it via PUBSPEC_LOCATION
env variable, so in case of GitHub actions it would look like this:
- name: 🚀🤖 Build & deploy Android release
shell: bash
run: |
cd android
bundle exec fastlane android beta
env:
PUBSPEC_LOCATION: ${{ github.workspace }}/pubspec.yaml
In my case the reason was actually that inside Fastlane script I changed the working folder to be something else, so the default relative path
../pubspec.yaml
would no longer be valid.But I found that it's possible to change it via
PUBSPEC_LOCATION
env variable, so in case of GitHub actions it would look like this:- name: 🚀🤖 Build & deploy Android release shell: bash run: | cd android bundle exec fastlane android beta env: PUBSPEC_LOCATION: ${{ github.workspace }}/pubspec.yaml
Thanks. That wasn't my case, as I tested that by removing the build number. That would lead to a different error, meaning that it would actually read the pubspec file
for me it works like this
`lane :version_number_flutter do vcode = flutter_version( pubspec_location: './pubspec.yaml', should_omit_version_code: true)["version_name"]
end`
Describe the bug "Read pubspec.yaml failed" on a YAML file that contains aliases on Linux (Fedora 38, tried using both bash and zsh). The same project works fine on macOS Ventura.
In the case of the yaml file below, the relevant alias is
isar_version
.To Reproduce Steps to reproduce the behavior:
android/fastlane/Fastfile
Expected behavior The YAML file should be parsed successfully.
Desktop (please complete the following information):
Additional context YAML file:
Error log: