Thursday, February 7, 2019

The sandbox is not in sync with the Podfile.lock in ionic


In my case, I was building an ionic project. This error comes when I try to run the project in iSO. I spend much time to resolve this issue, Some say we can run pod update OR pod install command to resolve this issue. But noting work in my case. Finally, I found the solution for this. This is very simple. Just follow the below steps to resolve the issue -    

1. First Quit your Xcode.
2. Now move in iOS platform folder. (i.e, Project Dir/platforms/ios)
3. Delete Pods folder from here.
4. Delete Podfile.lock from here.
5. Now open ios platform in the terminal and run "pod install" command in terminal. Make sure to run this command without admin (without sudo).
6. Now open your project in Xcode. Note - Open project via .xcworkspace file.

Now build and run the project, If that does not work follow below more steps - 

7. In Xcode, From navigation go to root node and from the Xcode on the right choose 'Build Settings' option.  Check more information in below image -




8. Now scroll down and there should be following entries - PODS_PODFILE_DIR_PATH and PODS_ROOT. If this available please correct the entry and if not available please add the entry by using below details - 


8.1 Click on the plus (+) icon to add the entry and select "Add user-defined settings". Check below image -




8.2 Add "PODS_PODFILE_DIR_PATH" and for both Debug and Release add "${SRCROOT}/." entry.
8.3 Now again add "PODS_ROOT" and for both Debug and Release add "${SRCROOT}/Pods" entry.

After adding the above details it will look like this -





Now try to build your project. It will build successfully. If still, you are facing any issue please post your error in the comment section. I will try to resolve this issue.