快车道 iOS update_info_plist "invalid byte sequence in UTF-8"

Fastlane iOS update_info_plist "invalid byte sequence in UTF-8"

我在使用 fastlane 的 'update_info_plist' 操作时遇到问题。

....../plist.rb:84:in `match': [!] invalid byte sequence in UTF-8 (ArgumentError)

底部完全错误

我最近按照 fastlane 的建议设置了一个 gemfile,这似乎把事情搞砸了。我按照上面说的做了:

[15:54:43]: $ [sudo] gem cleanup
[15:54:43]: $ bundle init
[15:54:43]: $ echo 'gem "fastlane"' >> Gemfile
[15:54:43]: $ bundle install

i 运行 我的车道像:

fastlane warmup

它现在抛出这个无效的字节序列错误

我正在使用 rbenv 并尝试将版本 2.0.0 和 2.2.2 设置到本地文件夹。没有不同 我还检查了建议的 github 问题,这些问题相似但不完全相同:

-https://github.com/fastlane/fastlane/issues/4027 -https://github.com/fastlane/fastlane/issues/2253 -https://github.com/fastlane/fastlane/issues/2389

非常感谢任何建议!,我试图避免卸载 rbenv 但这是我现在的怀疑 - 或损坏的 plist,但 plist 似乎没问题,我可以手动更改值并且它按预期工作。我还尝试将 GitHub 项目重新克隆到一个新文件夹 - 同样的事情发生了。

快车道版本 1.108

相关的快速文件部分:

      update_info_plist(
    app_identifier: flavor_data["identifier"],
    display_name: flavor_data["shortname"],
    plist_path: 'Files/Resources/Supporting Files/HealthInfo.plist',
    xcodeproj: 'Health.xcodeproj',
    )

  #update ServerURL
  set_info_plist_value(
    key: 'ServerURL',
    value: server_url,
    path: 'Files/Resources/Supporting Files/HealthInfo.plist',
    )
    update_app_identifier(
      xcodeproj: 'health.xcodeproj',
      plist_path: 'Files/Resources/Supporting Files/Info.plist',
      app_identifier: app_identifier
    # options[:app_identifier]
    )

这是我 运行 执行 'locale' 命令的打印输出。我相信这些是正确的设置

$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

此处完全错误:

/Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/xcodeproj-1.4.1/lib/xcodeproj/plist.rb:84:in `match': [!] invalid byte sequence in UTF-8 (ArgumentError)
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/xcodeproj-1.4.1/lib/xcodeproj/plist.rb:84:in `match'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/xcodeproj-1.4.1/lib/xcodeproj/plist.rb:84:in `file_in_conflict?'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/xcodeproj-1.4.1/lib/xcodeproj/plist.rb:20:in `read_from_path'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/actions/update_info_plist.rb:37:in `run'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/runner.rb:202:in `block (2 levels) in execute_action'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/actions/actions_helper.rb:35:in `execute_action'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/runner.rb:187:in `block in execute_action'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/runner.rb:186:in `chdir'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/runner.rb:186:in `execute_action'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/runner.rb:112:in `trigger_action_by_name'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/fast_file.rb:146:in `method_missing'
    from Fastfile:99:in `block in parsing_binding'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/lane.rb:33:in `call'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/lane.rb:33:in `call'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/runner.rb:165:in `try_switch_to_lane'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/runner.rb:120:in `trigger_action_by_name'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/fast_file.rb:146:in `method_missing'
    from Fastfile:80:in `block in parsing_binding'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/lane.rb:33:in `call'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/lane.rb:33:in `call'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/runner.rb:49:in `block in execute'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/runner.rb:45:in `chdir'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/runner.rb:45:in `execute'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/lane_manager.rb:52:in `cruise_lane'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/command_line_handler.rb:30:in `handle'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/commands_generator.rb:69:in `block (2 levels) in run'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/commander-4.4.0/lib/commander/command.rb:178:in `call'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/commander-4.4.0/lib/commander/command.rb:153:in `run'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/commander-4.4.0/lib/commander/runner.rb:444:in `run_active_command'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane_core-0.55.0/lib/fastlane_core/ui/fastlane_runner.rb:38:in `run!'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/commander-4.4.0/lib/commander/delegates.rb:15:in `run!'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/commands_generator.rb:266:in `run'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/commands_generator.rb:31:in `start'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/lib/fastlane/cli_tools_distributor.rb:58:in `take_off'
    from /Users/scc/.rbenv/versions/2.0.0-dev/lib/ruby/gems/2.0.0/gems/fastlane-1.108.0/bin/fastlane:5:in `<top (required)>'
    from /Users/scc/.rbenv/versions/2.0.0-dev/bin/fastlane:23:in `load'
    from /Users/scc/.rbenv/versions/2.0.0-dev/bin/fastlane:23:in `<main>'

我和我的同事解决了这个问题。 我们不得不更改 update_info_plist、update_app_identifier、set_info_plist_value 函数的顺序。可能存在竞争条件或其他问题!