phonegap / phonegap-plugin-push

Register and receive push notifications
MIT License
1.94k stars 1.91k forks source link

Can't build on iOS - "Podfile.lock: No such file or directory" #2193

Open AndrWeisR opened 6 years ago

AndrWeisR commented 6 years ago

Expected Behaviour

Build in Xcode is successful.

Actual Behaviour

Build in XCode 9.2 fails with errors. I opened the Xcode workspace, not the project.

PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock /Users/xxxxxx/Library/Developer/Xcode/DerivedData/push-efgaimzblszoyqbwasqbnmeshyyc/Build/Intermediates.noindex/push.build/Debug-iphonesimulator/push.build/Script-33A2F61D97683A39270A1262.sh
    cd /Users/xxxxxx/MobileDev/Push/platforms/ios
    /bin/sh -c /Users/xxxxxx/Library/Developer/Xcode/DerivedData/push-efgaimzblszoyqbwasqbnmeshyyc/Build/Intermediates.noindex/push.build/Debug-iphonesimulator/push.build/Script-33A2F61D97683A39270A1262.sh

diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS 10.13.2 I have installed CocoaPods 1.4.0

Cordova CLI version and cordova platform version

cordova --version   = 8.00
cordova platform version ios = 4.5.4

Plugin version

cordova plugin version | grep phonegap-plugin-push   = 2.1.3

Notes

Seems to be similar to issue #1668 My Podfile.lock does actually exist.

The .sh file that produces the error above contains:

diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
if [ $? != 0 ] ; then
    # print error to STDERR
    echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." >&2
    exit 1
fi

It looks like the PODS_PODFILE_DIR_PATH and PODS_ROOT variables are empty.

jaigtz88 commented 6 years ago

Variable ${PODS_ROOT} was not set and I do below trick.

Go to Build Phases -> Check Pods Manifest.lock and replace diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/ Manifest.lock" > /dev/null to diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/

macdonst commented 6 years ago

@AndrWeisR from the looks of the error message it seems something is wrong with your cocoapods install. Did you try running pod install as it suggested?

AndrWeisR commented 6 years ago

Yes, I did a pod install, but it didn't help. I had to do as @jaigtz88 above, and manually edit the command in the build phase to enter SRCROOT.

jaigtz88 commented 6 years ago

@AndrWeisR after i update cordova and cocopods, i dont have that error anymore

anas-p commented 6 years ago

Remove all the files related to pod from your project folder, Close xcode project and run pod init and open -a Xcode Podfile. Add your pod files again and run pod install. Reopen and run your project.

GoriX commented 6 years ago

Hi all people,

Same problem with high sierra 10.13.2 and Xcode 9.2, I had have all, delete, start from zero, more than 10 times, I have tested all posibles fixes from all posts related with this issue but always the same result, not working!!!

May be a problem with permissions? I don't know.... I changed PODS_PODFILE_DIR_PATH for real path /Users/...../documents..../ios/. and PODS_ROOT too and system return same error, it is as if system can't find or not have access to this path that is obvious that it exists...

Any help from somebody?

Thanks in advance.

mikeashelby commented 6 years ago

I have this same error, but I can't find the lines in manifest.lock referenced above to edit...

Is there any progress on this? Or anything else to try?

gersonmontenegro commented 6 years ago

I has had (at least per now), write the complete path to the .lock files in order to build the project, just like a show below:

check_pods At least it will work for me while I fix the issue with the path variables.

ivancho2802 commented 6 years ago

solved for me: XCODE, IOS, CORDOVA y IONIC

1 - in xcode change value of $(SRCROOT) for you root project in xcode las var of config build in user-defined enter image description here

2 - changed var in this clic in the plus of up: enter image description here

nota: root project is: location of my project and location where use pod this my firs question thank for watching

[(https://stackoverflow.com/questions/40095677/how-can-i-add-a-symbol-like-srcroot-to-use-in-an-xcode-projects-build-settin/51971532#51971532)]

aagaardmorten commented 6 years ago

Did you miss a " in the new script line? from diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/

to diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/"

markamccorkle commented 6 years ago

IMO, the better solution is to add a couple build user-defined settings. Go to your Project Target, change to Build Settings tab, press the '+' symbol, "Add User-Defined Setting".

PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
danielmartinsgit commented 6 years ago

@MarkAMcCorkle it work for me

conorthedev commented 6 years ago

@MarkAMcCorkle I'm not working on this project but ahhh thanks so much man! I'm trying to do something with Firebase and I wasn't able to build it!

Lifesaver!

ghost commented 5 years ago

@MarkAMcCorkle I tried this solution but still have the same error :/ ... This is how I have it setup: Build Settings :

screen shot 2018-12-01 at 23 45 38

Build Phases:

screen shot 2018-12-01 at 23 49 06

Error:

screen shot 2018-12-01 at 23 54 16

What should I do now??

ghost commented 5 years ago

IMO, the better solution is to add a couple build user-defined settings. Go to your Project Target, change to Build Settings tab, press the '+' symbol, "Add User-Defined Setting".

PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

Thank you a lot. It's save my whole day.

zaifz commented 5 years ago

Update your cocoapod using the command sudo gem install cocoapod in your terminal. I had the same issue and it seems like the cocoapod version was old.

Ha0Yan commented 5 years ago

Update your cocoapod using the command sudo gem install cocoapod in your terminal. I had the same issue and it seems like the cocoapod version was old.

It works for me!!!!!!

hellotunmbi commented 5 years ago

sudo gem install cocoapod

Kindly note it is 'cocoapods' not 'cocoapod'