Skip to content

Instantly share code, notes, and snippets.

  • Save PeterLi/0b59693b8a442fb022ccca2cafb35a5d to your computer and use it in GitHub Desktop.
Save PeterLi/0b59693b8a442fb022ccca2cafb35a5d to your computer and use it in GitHub Desktop.
Apple M1 (ARM) computer using Xcode Organizer failing on Distribute App with "The data couldn't be read because it isn't in the correct format" - SOLVED!
Exporting/Distribute App from Xcode Organizer generates an error on Apple M1 (ARM) computers/laptops... logs say the following.
2022-02-25 03:19:31 +0000 Running /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool '/var/folders/53/pg_50pq11q9grc5v9d0797880000gn/T/IDEDistributionOptionThinning.~~~pUVwZB' '--json' '/var/folders/53/pg_50pq11q9grc5v9d0797880000gn/T/ipatool-json-filepath-~~~u1TMB8' '--toolchain' '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr' '--platforms' '/Applications/Xcode.app/Contents/Developer/Platforms' '--app-store-tools-build-version' '13C100' '--info' '--no-validate-bitcode'
2022-02-25 03:19:31 +0000 ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
2022-02-25 03:19:31 +0000 /Library/Ruby/Gems/2.6.0/gems/CFPropertyList-3.0.3/lib/cfpropertylist/rbCFPropertyList.rb:83: warning: assigned but unused variable - temp
2022-02-25 03:19:31 +0000 /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require': dlsym(0x209017240, Init_date_core): symbol not found - /Library/Ruby/Gems/2.6.0/gems/date-3.1.1/lib/date_core.bundle (LoadError)
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /Library/Ruby/Gems/2.6.0/gems/date-3.1.1/lib/date.rb:4:in `<top (required)>'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /Library/Ruby/Gems/2.6.0/gems/CFPropertyList-3.0.3/lib/cfpropertylist/rbCFPropertyList.rb:4:in `<top (required)>'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
2022-02-25 03:19:31 +0000 from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /Library/Ruby/Gems/2.6.0/gems/CFPropertyList-3.0.3/lib/cfpropertylist.rb:3:in `<top (required)>'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:160:in `require'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:160:in `rescue in require'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:149:in `require'
from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:15:in `<main>'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require': cannot load such file -- cfpropertylist (LoadError)
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:15:in `<main>'
2022-02-25 03:19:31 +0000 /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool exited with 1
2022-02-25 03:19:31 +0000 ipatool JSON: (null)
2022-02-25 03:44:07 +0000 [MT] Canceled distribution assistant
Solution was change the xcode ipatool script to use a version of ruby what works on the machine:
=================================================================================================
(alternatively maybe you can get into the context of the ruby xcode is using and install all the needed resources)
editing /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool change the ruby path at the top of the file...
#!/usr/bin/sandbox-exec -n no-network /opt/homebrew/opt/ruby/bin/ruby -E UTF-8 -v
#ORIG!/usr/bin/sandbox-exec -n no-network /usr/bin/ruby -E UTF-8 -v
save the file changes, with sudo, as its modifying the file within the app...
This then gives another error that sqlite3 is not available when exporting again from Organizer. From logs:
2022-02-25 03:44:39 +0000 Running /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool '/var/folders/53/pg_50pq11q9grc5v9d0797880000gn/T/IDEDistributionOptionThinning.~~~k33cgh' '--json' '/var/folders/53/pg_50pq11q9grc5v9d0797880000gn/T/ipatool-json-filepath-~~~7rxcP4' '--toolchain' '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr' '--platforms' '/Applications/Xcode.app/Contents/Developer/Platforms' '--app-store-tools-build-version' '13C100' '--info' '--no-validate-bitcode'
2022-02-25 03:44:39 +0000 ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [arm64-darwin21]
2022-02-25 03:44:39 +0000 /opt/homebrew/lib/ruby/gems/3.0.0/gems/CFPropertyList-3.0.5/lib/cfpropertylist/rbCFPropertyList.rb:83: warning: assigned but unused variable - temp
2022-02-25 03:44:39 +0000 <internal:/opt/homebrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- sqlite3 (LoadError)
from <internal:/opt/homebrew/Cellar/ruby/3.0.3/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:25:in `<main>'
2022-02-25 03:44:39 +0000 /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool exited with 1
2022-02-25 03:44:39 +0000 ipatool JSON: (null)
2022-02-25 03:46:18 +0000 [MT] Canceled distribution assistant
which in the Terminal.app you then install...
% sudo gem install sqlite3
Password:
Building native extensions. This could take a while...
Successfully installed sqlite3-1.4.2
Parsing documentation for sqlite3-1.4.2
Installing ri documentation for sqlite3-1.4.2
Done installing documentation for sqlite3 after 0 seconds
1 gem installed
After lots of dead banging effort to get to this simple solution...
Now when you Distribute App in Xcode Organizer...
IT WORKS! Thank goodness!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment