Avoiding users accidentally opening Xcodeproj instead of Xcworkspace
Cross posted from: https://groups.google.com/forum/#!topic/cocoapods/7LV3LKI0hHE
React Native is moving towards Cocoapods being used by default for all newly created projects and using it to support a feature called "autolinking" (see here for details). This is primarily to fix a major pain point that users have with linking library dependencies in their iOS projects. Previously, over 50% of the "bugs" reported for library maintains would just be people linking the library incorrectly due to their lack of native iOS development knowledge. With Cocoapods and autolinking we hope this will go away.
One issue that we think React Native users might have is if they accidentally open the Xcodeproj file instead of the Xcworkspace and get build errors. We want to make it as clear as possible what went wrong to users who may have much iOS development experience and not understand the difference between the files. As this is not a React Native specific issue, but something all Cocoapod users need to remember, I think it best to ask for some advice.
- What can we do to encourage users to open the workspace instead of the project file? Can we "hide" the project file somehow, or is that more trouble than it's worth?
- Is there a way to show a clear error if the user tried to build from the project instead of the workspace file in Xcode? Anything we can do to avoid "linking errors" or anything else which is cryptic to users without much native development experience is a bonus.
You can move the .xcodeproj
file to other sub folders.
And add xcodeproj 'yoursubfolder/test.xcodeproj'
above target 'test' do
in your podfile