Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.
like image 818
matto1990 Avatar asked May 15 '19 16:05

matto1990


People also ask

Should I open Xcodeproj or Xcworkspace?

You should see them side by side in your project folder. The xcworkspace is created by cocoapods and needs to be opened instead of the xcodeproj. So that xcode resolves dependencies properly.

How do I open a Xcworkspace file?

xcworkspace file corresponds to a “workspace” created in Xcode via File > New > Workspace... . You can open them in Xcode, just like you can open projects.

How do I add Xcodeprocode to Xcworkspace?

In the Project navigator, Control-click in the empty space and choose Add Files to “workspaceName”. In the sheet that appears, select an Xcode project (a file with a . xcodeproj filename extension). Click Add to add the project to the workspace.

How do I change my Xcworkspace name?

Open your project folder and rename OLD. xcworkspace to NEW. xcworkspace. In the correct named master folder, there will be a newly named .


1 Answers

You can move the .xcodeproj file to other sub folders. And add xcodeproj 'yoursubfolder/test.xcodeproj' above target 'test' do in your podfile

like image 108
arun siva Avatar answered Nov 13 '22 23:11

arun siva