Pod init does not work on Xcode 16 for now.
[10/04, 2024] |
Isn't it exciting to always have the latest version of software? Hi, I'm Tomo. Recently, after upgrading to Xcode 16, I encountered an error when trying to run pod init.
The Conclusion First
The solution was to
- download Xcode 15.
- Create the project in Xcode 15.
- Run pod init.
- Then open the project in Xcode 16 and continue working.
The Journey to the Solution
- As of now, CocoaPods doesn’t support Xcode 16 (specifically, folder-based project management).
- I was able to run pod init using a workaround found on CocoaPods’ GitHub.
- However, I couldn’t run the project on a real device due to an error about a missing provisioning profile.
- Downloaded Xcode 15.
- But Xcode 15 isn’t supported on macOS Sequoia, so it wouldn’t start.
- Ran Xcode 15 from the command line.
- Created a project in Xcode 15.
- Successfully ran pod init.
- Then continued the project in Xcode 16 (success!).
CocoaPods Doesn’t Support Xcode 16 (Folder-Based Management)
Currently, CocoaPods doesn’t support Xcode 16. On GitHub, an issue was raised, and a workaround was suggested.
The Workaround on GitHub
On Github, the following method was suggested:
- Open the “xcodeproj” file in a text editor and make the following changes:
- Remove minimizedProjectReferenceProxies = 1;
- Remove preferredProjectObjectVersion = 77;
- Change objectVersion = 77; to objectVersion = 56;
- Convert all folders to groups using “Convert to Group.”
By following this method, I was able to successfully run pod init.
However, after creating the project with this method, I encountered the following error when trying to run the project on a real device:
Please ensure entitlements claimed by the app are present in the provisioning profile. If this issue persists, please attach an IPA of your app when sending a report to Apple.
couldn’t run the app on a real device due to this error, and I wasn’t able to figure out why, even though my provisioning profile was up to date.
What is Folder Management?
Starting with Xcode 16, the default management method has been changed from “Group” to “Folder.”
I’m not too familiar with the details, but:
- Group: The xcodeproj file lists each file to be built.
- Folder: The xcodeproj file lists the path of the folder to be built.
This change supposedly reduces conflicts in xcodeproj when multiple people are working on a project.
I always thought of Group as a reference and Folder as the actual location, but it seems I was mistaken.
Downloaded Xcode 15 but It Wasn’t Supported on Sequoia
So, I decided to use Xcode 15 to run pod init. I downloaded the older version of Xcode.
You can download older versions of Xcode here.
After downloading and trying to launch it, I got this error:
The version of Xcode installed on this Mac is not compatible with macOS Sequoia.
So it wouldn’t start.
I thought I was stuck, but then I found a method to launch Xcode from the command line in this article.
In my case, since I had extracted Xcode directly into the Downloads folder, the command looked like this:
open /Downloads/Xcode.app/Contents/MacOS/Xcode
Or more generally:
open /path/to/Xcode.app/Contents/MacOS/Xcode
This allowed me to launch Xcode from the command line without any issues. However...
Even after launching it, there was a strict 🚫 mark on it (classic Apple, right?).
I wonder how it knows? I mean, it can display the mark, but the app runs fine… What's going on here? 😂
Anyway, I was able to create a new project and run pod init (& update).
Once the project is created, you can use Xcode 16 to run pod install/update without issues.
Hopefully, CocoaPods will support Xcode 16 soon!
And that’s the happy ending.