我正在使用吊舱chronotruck/Flag电话号码 https://github.com/chronotruck/FlagPhoneNumber/issues/103我刚刚更新自High Sierra/Xcode 10.1/Swift 4.2/Cocoapoods v-1.5.3
to Mojave 10.14.15/Xcode 10.2.1/Swift 5/Cocoapoods v-1.7.3
我无法建造,因为里面NBRegExMatcher.m
文件我收到错误
找不到“NBPhoneNumberDesc.h”文件
升级之前一切正常,我从未遇到过任何此类错误。
Podfile.lock 里面有这个:
- FlagPhoneNumber (0.7.6):
- FlagPhoneNumber/libPhoneNumberiOS (= 0.7.6)
- FlagPhoneNumber/libPhoneNumberiOS (0.7.6)
奇怪的是,该 pod 中的其他几个文件也使用#import "NBPhoneNumberDesc.h"
模块,但它们都工作正常并且没有任何错误
I tried 这个答案 https://stackoverflow.com/a/33865771/4833705但 NBPhoneNumberDesc.h 已经在公共部分中:
我也尝试过这个答案 https://stackoverflow.com/a/41543823/4833705设置 SWIFT_OBJC_INTERFACE_HEADER_NAME 以匹配我的项目的桥接标头,但什么也没有
在 - 的里面NBRegExMatcher.m
文件(发生错误的地方)我注释掉了#import NBPhoneNumberDesc.h
看看会发生什么,然后 NBPhoneNumberUtil.h 得到同样的错误:
我注意到libPhoneNumber-iOS
捆绑在里面FlagPhoneNumber
pod 的版本是libPhoneNumberiOS (0.7.6)
。然后我手动添加了 Pod https://cocoapods.org/pods/libPhoneNumber-ios到我的项目看看会发生什么,但这也没有什么区别,错误仍然存在。我唯一注意到的是,当我手动添加 pod 时,Podfile.lock 版本是- libPhoneNumber-iOS (0.9.15)
其中 FlagPhoneNumber 使用的版本是libPhoneNumberiOS (0.7.6)
知道如何修复这个错误吗?
我尝试了一些关于更改“构建设置”>“头文件”和/或“用户头文件”内的内容的答案,但没有一个起作用。我跟着这个答案 https://stackoverflow.com/a/16783389/4833705它起作用了:)
我要做的就是改变#import SomeFile.h
to #import <SomeFile.h>
通过使用括号来代替。
这是每个文件的代码
在 - 的里面NBRegExMatcher.m
文件我必须更改这两个模块:
//#import "NBPhoneNumberDesc.h" // comment this out and add the brackets below
#import <NBPhoneNumberDesc.h>
//#import "NBPhoneNumberUtil.h" // comment this out and add the brackets below
#import <NBPhoneNumberUtil.h>
在我改变了这些之后,我也在里面得到了同样的错误NBPhoneNumberUtil.m
并且必须在那里做同样的事情:
//#import "NBRegExMatcher.h" // comment this out and add the brackets below
#import <NBRegExMatcher.h>
以下是每张照片:
NBRegExMatcher.m
file
NBPhoneNumberUtil.m
file
顺便说一句,我还必须添加pod 'libPhoneNumber-iOS', '~> 0.8'
到我的 Podfile,因为出现了不同的错误,因为我在 libPhoneNumber pod 之外使用了该库
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)