我已经构建了一个使用Intercom(第三方扩展)的Ionic 2应用程序。 Intercom是使用cocoapods安装的。
编译我的应用程序时,会出现以下错误:
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.
这是由构建阶段生成的 [CP] 检查 Pods Manifest.lock
:
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
# This output is used by Xcode 'outputs' to avoid re-running this script phase.
echo "SUCCESS" > "${SCRIPT_OUTPUT_FILE_0}"
我尝试通过上面脚本中STDERROR
的echo
输出环境变量PODS_PODFILE_DIR_PATH
和PODS_ROOT
,但两者都为空。我可能可以通过自己修改这些路径来解决特定的错误,但显然还有更根本的问题需要修复。
为什么这些变量是空的呢?
我有一些其他的构建阶段,包括[CP] Copy Pods Resources
和[CP] Embed Pods Frameworks
,其中运行了一些shell脚本。我尝试过改变这些顺序,但没有成功。
我的Podfile.lock和Podfile(后者是自动生成的)看起来都很好:
Podfile:
# DO NOT MODIFY -- auto-generated by Apache Cordova
platform :ios, '8.0'
target 'niix' do
project 'niix.xcodeproj'
pod 'Intercom', '~> 3.2.2'
end
Podfile.lock:
PODS:
- Intercom (3.2.12)
DEPENDENCIES:
- Intercom (~> 3.2.2)
SPEC CHECKSUMS:
Intercom: 3119e8ebf76d3da425bab717a08067398fcabfe6
PODFILE CHECKSUM: f99283bb8a4e56cb037a02390d2fbc4e76c97db9
COCOAPODS: 1.3.1
执行pod install
时没有任何错误,并且我预期的所有文件都存在。
我已经尝试过以下几种方法:
- 运行
pod install
(当然) - 运行
pod deintegrate
,在XCode中运行Product > Clean,重新运行pod install
- 手动删除
Podfile.lock
和Pods
目录,在XCode中进行清理,然后重新运行pod install
- 好好睡一晚上,第二天再尝试!
需要注意的事项:
- 我正在从
project.xcworkspace
而不是project.xcodeproj
中运行 - 我正在运行最新稳定版本的XCode 8.3.3
- 我正在运行最新版本的Cocoapods 1.3.1