react-native link - "...there are multiple xcodeproj under the solution"
Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):
Steps to Reproduce
- React Native init app with pods
- install react-native-code-push
- react-native link
Expected Behavior
What you expected to happen? The project should link to both ios and android
Actual Behavior
Since my project already uses Pods the post script that is being ran is trying to look for
function getPlistPath(){
var xcodeProjectPaths = glob.sync(`**/*.xcodeproj/project.pbxproj`, ignoreNodeModules);
....
There are 2 files that satisfy this condition, the Pod file and the project file therefore we get the error below:
Running ios postlink script
Could not determine correct xcode proj path to retrieve related plist file, there are multiple xcodeproj under the solution.
Environment
- react-native-code-push version:
5.2.1 The issue is only with IOS!!!
Workaround
Edit the /node_modules/react-native-code-push/scripts/postlink/ios/postlink.js file
replace <your project name>
var xcodeProjectPaths = glob.sync(`**/<your project name>.xcodeproj/project.pbxproj`, ignoreNodeModules);
Now run react-native link 👍
Hi @shyaniv7, thank you for reaching us and submitting an issue.
Could you please clarify - do I get it right if your workaround assumes that each dev (who has several projects) will have to edit postlink.js manually? If so, I think we need to improve it - our goal is to reduce manual installation steps as much as possible.
I can see the following solution for your use case - instead of throwing
Running ios postlink script
Could not determine correct xcode proj path to retrieve related plist file, there are multiple xcodeproj under the solution.
we can output a list of available xcodeproj projects and prompt a user to select needed one.
This issue looks very specific so we are going to take care of it in order of priority, (currently we are working on CodePush SDK to AppCenter SDK migration).
Anyway, this issue does not look very difficult so we'll be very grateful if you have a chance and time to make a contribution and fix this issue.
@sergey-akhalkov After playing with it a bit more i realized that my workaround only goes through a partial link, the .xcodeproj file was not moved from node_modules and the CodePush.h file was not linked which resulted in errors and forced me to go through a manual link which worked.
I will attempt to fix the post link script and make a contribution.
@shyaniv7, got it, thanks for the clarification.
I will attempt to fix the post link script and make a contribution.
Great! Please let us know if you have any questions.
Is there any update on this?
I am receiving the same error. A codepush release works on the simulator, but causes the app on a device to crash and never be able to restart the app once a release is recognized.
After investigating the installation I tried react-native link again and received this output
Scanning 762 folders for symlinks in ...
rnpm-install info Android module react-native-code-push is already linked
rnpm-install info iOS module react-native-code-push is already linked
Running ios postlink script
"CodePush.h" header already imported.
"jsCodeLocation" already pointing to "[CodePush bundleURL]".
Could not determine correct xcode proj path to retrieve related plist file, there are multiple xcodeproj under the solution.
"CodePushDeploymentKey" already specified in the plist file.
Running android postlink script
"getJSBundleFile" is already overridden
"codepush.gradle" is already linked in the build definition
RN version: 0.44.1 CodePush version: 5.2.1
@DaddyWarbucks thanks for letting us know, at that moment we are not working on this task but we are always welcome if anyone would like to contribute and are ready to help/review the changes.
At that moment please remember that you are still able to do manual linking of codepush in that case, so you won't be blocked.
Unfortunately I was not able to fix the post link script, The nested promises were over my head.
For now I suggest defaulting to the manual link
The problem in my case was that ios/Pods/Pods.xcodeproj was there after some tests that I made. After removing it, everything works. Maybe a workaround would be moving it temporarily to other place and them moving it back to the correct place.

That glob selection is not considering situations with CocoaPods.
It's actually just two lines of code to fix:
https://github.com/Microsoft/react-native-code-push/pull/1262
Hey, there! Could you please test and confirm that #1268 works?
Hi @shyaniv7, we've tested and it seems that everything looks good. Thanks @tmaly1980 for fix! I'll close this issue but feel free to reopen this or create a new one if you have any questions. Thanks for using CodePush!