Lan*_*ria 4 module header-files ios cocoapods swift
我正在使用 pod chronotruck/FlagPhoneNumber我刚刚更新为High Sierra/Xcode 10.1/Swift 4.2/Cocoapoods v-1.5.3to 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)
Run Code Online (Sandbox Code Playgroud)
奇怪的是,该 pod 中的其他几个文件也使用该#import "NBPhoneNumberDesc.h"模块,但它们都工作正常并且没有任何错误
我尝试了这个答案,但 NBPhoneNumberDesc.h 已经在公共部分:
我还尝试了这个答案来设置 SWIFT_OBJC_INTERFACE_HEADER_NAME 以匹配我的项目的桥接标头,但没有任何结果
在文件内NBRegExMatcher.m(发生错误的地方)我注释掉#import NBPhoneNumberDesc.h以查看会发生什么,然后 NBPhoneNumberUtil.h 得到相同的错误:
我注意到它libPhoneNumber-iOS捆绑在FlagPhoneNumber吊舱内,它的版本是libPhoneNumberiOS (0.7.6). 然后,我手动将 pod 添加到我的项目中,看看会发生什么,但这也没有什么区别,错误仍然存在。我唯一注意到的是,当我手动添加 Pod 时,Podfile.lock 版本是- libPhoneNumber-iOS (0.9.15)其中,而 FlagPhoneNumber 正在使用的版本是libPhoneNumberiOS (0.7.6)
知道如何修复这个错误吗?
我尝试了一些关于更改“构建设置”>“头文件”和/或“用户头文件”内的内容的答案,但没有一个起作用。我遵循了这个答案并且成功了:)
我所要做的就是使用括号来更改#import SomeFile.h为。#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>
Run Code Online (Sandbox Code Playgroud)
在我更改这些之后,我也在其中遇到了相同的错误NBPhoneNumberUtil.m,并且必须在那里执行相同的操作:
//#import "NBRegExMatcher.h" // comment this out and add the brackets below
#import <NBRegExMatcher.h>
Run Code Online (Sandbox Code Playgroud)
以下是每张照片:
顺便说一句,我还必须将其添加pod 'libPhoneNumber-iOS', '~> 0.8'到我的 Podfile 中,因为由于我在 FlagPhoneNumber pod 之外使用了该库,所以出现了不同的错误
| 归档时间: |
|
| 查看次数: |
1589 次 |
| 最近记录: |