iOS 开发中问题记录

模拟器

一:键盘无法弹出,无法输入任何内容

解决方案:CMD + SHIFT + K弹出键盘,如果CMD + SHIFT + K也无法弹出键盘,就进入~/Library/Preferences/com.apple.iphonesimulator.plist,找到对应的模拟器的CaptureKeyboardInput选项设置为YES,重启模拟器就可以了。

pod

一:pod lib lint 一直提示None of your spec sources contain a spec satisfying the dependency,工程编译成功,执行pod install --repo-update后也无效。

解决方案:添加上--sources='https://github.com/CocoaPods/Specs.git'就可以了。

二:pod trunk push提示Authentication token is invalid or unverified,git config user.password无效。

使用pod trunk register '邮箱地址',在邮箱中点击校验链接再推送就可以了。

三:pod lib lint 通过,但是pod spec lint 报错:Encountered an unknown error (Unable to find other source ref for `Contents.json` for target

原因是两个xcassete资源库导致的。targets-general-app icons sources取消APPicon就可以了。

四:其他报错
  • # [No visible @interface in Cocoapods]把import 放到.m文件中。
五:换了一个电脑开发,新电脑pod库版本低,想要更新pod库的时候

经历了无数次的pod repo update master失败,包括但不限于

error: RPC failed; curl 18 transfer closed with outstanding read data remaining
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54

增加了缓存(眼看就要到4G了)、
限制了网速

pack.windowmemory=100m
pack.sizelimit=100m
pack.threads=1
pack.window=0

取消了ssl校验http.sslverify=false等等都无果的情况下。
我找到了另外一种临时方案。

  • 直接从原来的电脑拷贝pod的master,手动骗电脑,我master更新了。
  • 找到文件夹:/用户/资源库/Caches/CocoaPods/Pods,把原来电脑的东西都给copy过来。
  • 进入需要Pod install的工程开始pod install
  • done

你可能感兴趣的:(iOS 开发中问题记录)