Run script only when installing

2017-10-19  本文已影响0人  abc鱼

问题:

MJRefresh的文案没有正确显示, 如下图.

文案没有正确显示.png

找问题

  1. 发现 Resource 是存在的.


    Resources.png
  2. 跟踪代码, NSBundle+MJRefresh.m 发现 bundle 是 nil.


    代码截图.png
  3. 在 .app 中没找到 MJRefresh.bundle, 并在搜索 bundle 时发现 pods 中的 bundle 全都没有在 .app 中. 推测是 CocoaPods 的问题.


    屏幕快照 2017-08-10 下午4.49.13.png

总结

问题: Pods 中的 Bundle 文件没有被编译到 .app

解决方法:
路径: targets -> build phases -> copy pods resources

Run script only when installing

With Run script only when installing checked, the script only runs when do Product Archive.(来自 stackoverflow)

所以如果勾选, 则在run的时候会看不到 pods 的资源文件.

解决方案, 第一次运行的时候不勾选, 之后勾选.

截图.png
上一篇 下一篇

猜你喜欢

热点阅读