9

Using Xcode v11.3 I try to export my .IPA file and get this error.

An error occurred during export. The data couldn’t be read because of it isn’t in the correct format

This is shown in IDEDistribution.standard.log

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- cfpropertylist (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:15:in `<main>'
2020-02-05 07:57:11 +0000  /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool exited with 1
2020-02-05 07:57:11 +0000  ipatool JSON: (null)

I have tried rvm use system but in vain. Thanking in anticipation.

vedant shirke
  • 359
  • 4
  • 9

2 Answers2

12

TL;DR

Running:

$ gem install CFPropertyList
$ gem install sqlite3

and then restarting solved it for me.


Full story:

I've just had the same problem. Googling around I found this article which talks about a different problem, but pointed me to the right direction: there is an issue with Ruby.

I then bumped into this issue which focused on the cannot load such file -- cfpropertylist part of the error message.

Running gem install CFPropertyList effectively allowed me to move forward one more step. This time a similar error complained about sqlite3. Running gem install sqlite3, again, should solve the problem.

Please note that you need SQLite installed systemwide (brew install sqlite), and that you NEED to restart your system, for whatever reason.

mjsarfatti
  • 1,725
  • 1
  • 15
  • 22
  • Thank you @mjsarfatti ! I've got the same issue with sqlite3 and it has been solved with your advice! `/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- sqlite3 (LoadError)` – Konstantinos May 01 '20 at 10:25
  • After running these commands, I restarted Xcode and that solved the issue – baskInEminence Jul 21 '20 at 05:36
  • Still facing the issue. Using M1 mac. – rv7284 Feb 28 '22 at 17:22
  • If this doesn't work, try opening Xcode with Rosetta it solved my problem. – Neeraj Joshi Apr 11 '22 at 12:17
  • 1
    Thank you very much. `gem install sqlite3` was my issue as per the XCode logs. No idea why it would require that when everything was working a day prior. – offworldwelcome Oct 07 '22 at 14:57
  • 1
    Who are struggling with M1 macs, running in Terminal `gem install sqlite3 --platform arm64-darwin` instead of just `gem install sqlite3` has worked for me – Dmitrii Klassneckii Oct 11 '22 at 09:59
  • @DmitriiKlassneckii That worked for me. I'm on a M1 Mac. Thank you. – Isuru Dec 14 '22 at 17:01
0

to fix it on M1 Mac

Go to Xcode foldar > right click open Get Info > make sure open using Rosetta has been checked

don't forget quit Xcode then open it