问题1:
编译无法通过,出现错误:

一般出现这种和 _sqlite 相关的错误,表示缺少sqlite依赖库,
解决方法(1):在工程中,添加系统依赖库

问题2:
编译出现error如下:

出现这种错误,可能有两种情况
第一:是工程中的 Build Phases --> Compile Sources 中导入的资源文件出错,找到对应的文件重新导入即可;
第二:是在Build Setting 中进行修改配置,将 3 中选项改成 YES即可

问题3:
出现如下错误,工程无法运行

一般导致这个错误的原因是修改了工程的 Bundle ID
解决方案【建议】:在 info.plist 中将 Bundle ID同时修改一致,然后 clear 工程,并且删除 App
问题4:

ld: 'XXX' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
当使用第三方库的时候,如果编译时出现了这种错误的话,是证明使用的第三方库不支持 bitcode,但是你在工程中开启了Enable Bitcode
解决方法:
(1)使用支持 Enable Bitcode 的第三方库
(2)将工程中的 Enable Bitcode 设置为 NO

问题5:
当使用证书进行真机调试时如果出现这种错误:
Your build settings specify a provisioning profile with the UUID, no provisioning profile was found

证明你在工程中使用的配置文件出现了问题,首先需要到工程中检查看是否配置文件选择错误:

如果确认证书没问题的话,那么就需要进行如下配置进行解决了:
解决方法
(1)找到项目中的*.xcodeproj文件,点击右键,或者直接点击项目名称,右键 show in finder (打开包内容)。
(2)打开后找到project.pbxproj文件,用文本编辑器打开。其实就是右键,点击open就好了。
(3)打开这个文件后,按command+F,在这个文件中查找“PROVISIONING_PROFILE",找到和这个
“PROVISIONING_PROFILE="487F3EAC-05FB-4A2A-9EA0-31F1F35760EB";
"PROVISIONING_PROFILE[sdk=iphoneos]"="487F3EAC-05FB-4A2A-9EA0-31F1F35760EB";”
类似的都删除
(4)然后保存文件,重新打开项目。xcode会提示你重新下载安装provisioning profile文件,下载后安装上就可以。
问题 6:
当使用模拟器编译程序时,

遇到 invalid device state xcode 这种错误时,肯定会让人一头雾水!其实这一般是 xcode 在开一个小玩笑。解决方法:
(1)command + shift + k 清理
(2)将工程中的 .app 文件删除
(3)删除模拟器上的应用
(4)切换模拟器重新运行
大部分情况下,这四步没走完,问题就已经解决啦
问题 7:
在应用中,一般都会自定义导航样式,有些时候可能会出现自定义导航之后,运行程序会发现有些页面第一次进入时正常,但是导航 push 再 pop 回这个页面时,视图会莫名其妙的向下偏移 一段距离(64),无论如何调约束和位置都无法解决问题,然后就苦恼了。。。

解决方法
仔细检查自定义的导航样式,尤其是 navigationBar.translucent 属性,如果设置成 NO 的话,就会造成这种现象,所以要进行如下设置
self.navigationController.navigationBar.translucent = NO
网友评论