iOS Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not us...

iOS Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes

从github上下载的工程大部分都使用了cocapods,在install的时候可能会报错。

报错原因:

1、不要使用文本编辑去编辑Podfile文件,使用Xcode编辑,或者使用终端敲命令去编辑。

2、Podfile 的内容语法格式有问题

方法一: vim 修改

修改步骤
1. cd 进入到工程目录(podfile 上一级目录)

2.vim podfile 。进入到podfile文件中,对podfile文件进行编辑

3.按  i  键,进入编辑状态

4. 在pod ‘ ’ v2.0.2 最上面添加一行命令   target ‘xxxxx‘ do  , xxxxx代表工程的名字。

5.在pod ‘ ’ v2.0.2 最下面添加一行命令    end   

6.按键ESC,输入命令 :wq  ,保存并退出

7. 再  pod install  即可。

方法2: 手动修改

  1. 检查podfile 语法格式
  2. '
  3. platform 平台只需要一个,
  4. 一个target 对应一个end
  5. 如果两个target 都需要引入框架
 platform :ios, '9.0'
target 'XXXXtarget1', 'XXXXtarget2'  do        

pod 'AFNetworking', '~> 3.0’  
pod 'Masonry', '~> 0.6.4'
pod 'Protobuf'

end

如果工程有多个target 分别引入不同的框架


 platform :ios, '9.0'//平台只需要一个,

target 'XXXXtarget1' do                  
  # Uncomment this line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for AudioNote
pod 'AFNetworking', '~> 3.0’  
pod 'Masonry', '~> 0.6.4'
pod 'Protobuf'
end 

target 'XXXXtarget2' do
    pod 'Masonry', '~> 0.6.4'
    
end

转载-原文链接

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容