错误提示:fatal error: file ‘/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h‘ has been modified since the precompiled header ‘/Users/Rain/Library/Developer/Xcode/DerivedData/ModuleCache/VAU3ZWN6T3KV/UIKit-2M4VYLEDI34V0.pcm‘ was built
note: please rebuild precompiled header ‘/Users/Rain/Library/Developer/Xcode/DerivedData/ModuleCache/VAU3ZWN6T3KV/UIKit-2M4VYLEDI34V0.pcm‘
1 error generated.
解决办法:删除以上标记的’/Users/imac/Library/Developer/Xcode/DerivedData/ModuleCache/1M29HZNHW3I5B/UIKit-2M4VYLEDI34V0.pcm文件。
删除之后好有可能出现fatal error: could not build module ‘UIKit’错误提示, 办法是删除/Users/imac/Library/Developer/Xcode/DerivedData/ModuleCache文件夹,重新编译、运行方可。
注意:imac下的Library(资源库)一般都隐藏啦,进入终端,输入chflags nohidden ~/Library/就可以了。
错误提示:Failed to instantiate the default view controller for UIMainStoryboardFile ‘Main‘ - perhaps the designated entry point is not set?
原因分析:在StoryBoard中没有一个view controller设置了Initial Scene。
解决方案:在Storyboard中,选择一个view conroller作为story board的第一启动界面。如果导航控制器是初始界面,那应该把导航控制器设为初始启动界面,而不是登录界面。
错误提示:target specifies product type ‘com.Apple.product-type.bundle.ui-testing‘, but there‘s no such product type for the ‘iPhonesimulator‘ platform!
解决方案:http://www.07net01.com/2015/09/930192.html
错误提示:ld: library not found for -lPods-AFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解决方案:下载的开源APP使用了使用了CocoaPods,要使用workspace打开,而不是直接打开xcodeproj文件。
错误提示: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.
解决办法:1.安装CocoaPods;2.用pod install命令导入项目依赖框架;3.打开xcworkspace文件(不要用xcproj文件打开)
安装依赖框架需要定位到项目所在目录“cd /Users/Rain/Documents/开源/开源APP/GreatReader-master”再执行“pod install”命令(这个命令会运行项目里包含的Podfile文件)
错误提示:Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`
解决办法:sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer,后面的地址可以打开Xcode显示包内容,找到那个文件夹拖到终端里。