kpogz kpogz - 17 days ago 4
Ruby Question

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

I am experiencing an issue with fastlane's 'update_info_plist' action.

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


full error at bottom

I recently setup a gemfile as fastlane suggests and this seemed to have messed things up. I did what it said:

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


i run my lane like:

fastlane warmup


and it now throws this invalid byte sequence error

im using rbenv and tried setting versions 2.0.0 and 2.2.2 to the local folder. no difference
I also checked the suggested github issues which are similar but not quite the same:


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


any advice greatly appreciated!, I am trying to avoid uninstalling rbenv but that is my suspicion right now - or corrupt plist, but the plist seems to be okay, i can manually change the values and it works as expected. I also tried recloning the GitHub project to a new folder - same thing happening.

fastlane version 1.108

relevant fastfile part:

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]
)


heres a printout of me running the 'locale' command. i believe these are the correct settings

$ 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"


full error here:

/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>'

Answer

my coworked an i solved the issue. we had to change the order of the update_info_plist, update_app_identifier, set_info_plist_value functions. there may be a race condition or something!