Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failing to add pod file to Xcode 13 project

I am trying to add a pod file to my project but I consistently get this error in the terminal. Does anyone know how to fix this? Or is it because I already use Xcode 13 with iOS 15 beta? My Project is called AdMob testing because I wanted to use Cocoapods for Admob in case you wondered. Thanks.

myName@MacBook AdMob testing % pod init

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

Command

/usr/local/bin/pod init

Report

  • What did you do?

  • What did you expect to happen?

  • What happened instead?

Stack

   CocoaPods : 1.10.1
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
    RubyGems : 3.0.3
        Host : macOS 11.5 (20G5023d)
       Xcode : 12.5 (12E262)
         Git : git version 2.30.1 (Apple Git-130)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-trunk       : 1.5.0
cocoapods-try         : 1.2.0

Error

RuntimeError - [Xcodeproj] Unknown object version.
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.19.0/lib/xcodeproj/project.rb:227:in `initialize_from_file'
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.19.0/lib/xcodeproj/project.rb:112:in `open'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/init.rb:41:in `validate!'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:333:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=%5BXcodeproj%5D+Unknown+object+version.&type=Issues

If none exists, create a ticket, with the template displayed above, on: https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket: https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...

  • [Xcodeproj] Unknown object version. Help Please https://github.com/CocoaPods/CocoaPods/issues/10604 [open] [6 comments] a week ago

  • POD INIT ERROR https://github.com/CocoaPods/CocoaPods/issues/10728 [open] [0 comments] 2 days ago

  • Xcode-beta 13.0 can't init project https://github.com/CocoaPods/CocoaPods/issues/10713 [open] [9 comments] 3 days ago

and 62 more at: https://github.com/cocoapods/cocoapods/search?q=%5BXcodeproj%5D%20Unknown%20object%20version.&type=Issues&utf8=✓

This is the full error. Thanks for ideas.

like image 627
Rob Avatar asked Jun 24 '21 16:06

Rob


3 Answers

Change the project to Xcode 12.0 compatible. Thanks to https://github.com/CocoaPods/CocoaPods/issues/10713#issuecomment-865145924

enter image description here

like image 105
Paul Beusterien Avatar answered Nov 16 '22 23:11

Paul Beusterien


Don't forget after changing Project Format you also need to update the xcodeproj with:

sudo gem update xcodeproj
like image 43
BabakHSL Avatar answered Nov 16 '22 23:11

BabakHSL


Run the following commands in terminal:

  1. sudo gem update xcodeproj
  2. sudo arch -x86_64 gem install ffi
  3. arch -x86_64 pod install

It works for me!

like image 28
Sukh Avatar answered Nov 16 '22 23:11

Sukh