Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'NBPhoneNumberDesc.h' file not found after updating to Xcode 10.2, Swift 5 #103

Closed
lsamaria opened this issue Jul 3, 2019 · 3 comments
Closed

Comments

@lsamaria
Copy link
Contributor

lsamaria commented Jul 3, 2019

Describe the bug
I just updated to Xcode 10.2, Swift 5, MoJave and I can't build because I get the error

'NBPhoneNumberDesc.h' file not found that is located inside the NBRegExMatcher.m file

To Reproduce
Steps to reproduce the behavior:

  1. Update from High Sierra/Xcode 10.1/Swift 4.2 to Mojave 10.14.15/Xcode 10.2.1/Swift 5
  2. I used the current version of cocoapods 1.7.3 and the error appeared along with other errors. I downgraded to cocoapods 1.5.3 (version that worked fine in High Sierra) and the other errors went away but this error remained. I'm still using cocoapods 1.5.3

Expected behavior
This never happened before the upgrade

Screenshots
Screen Shot 2019-07-03 at 6 22 30 AM
Screen Shot 2019-07-03 at 6 28 17 AM

Smartphone (please complete the following information):

  • Device: This has nothing to do with the device because this is a compile error
  • OS: MoJave 10.14.5, Xcode 10.2.1
  • Version: Kernel Version: Darwin 18.6.0

FlagPhoneNumber (please complete the following information):

  • Version
- FlagPhoneNumber (0.7.6):
    - FlagPhoneNumber/libPhoneNumberiOS (= 0.7.6)
  - FlagPhoneNumber/libPhoneNumberiOS (0.7.6)

Additional context
Here is my q&a about the cocoapod version issue and the reason I switched from 1.7.3 to 1.5.3
https://stackoverflow.com/a/56866673/4833705

Please rememeber that this same 'NBPhoneNumberDesc.h' file not found issue still occurred when I was using 1.7.3

Also, according to this answer, NBPhoneNumberDesc.h should be in the Public section which it already is:

Screen Shot 2019-07-03 at 7 28 28 AM

--------------------------------UPDATE---------------------------------------

Inside the NBRegExMatcher.m file I commented out #import NBPhoneNumberDesc.h to see what would happen and then NBPhoneNumberUtil.h got the same error:

Screen Shot 2019-07-03 at 7 40 59 AM

There are several other .m classes that use the NBPhoneNumberDesc.h library and none of them are complaining, maybe the problem is specific to the NBRegExMatcher.m file:

Screen Shot 2019-07-03 at 7 46 00 AM

I also asked a question on SO and now I'm working on cocoapods v-1.7.3

I asked this question on SO to see if anyone over there could possibly identify the issue

@lsamaria
Copy link
Contributor Author

lsamaria commented Jul 6, 2019

I posted this answer on SO, right now there aren't any comments to address the issue but if it happens to you maybe you can check to see what commenters say if there are any in the future.

I tried a bunch of answers about changing things inside Build Settings > Header File and/or User Header files but none of them worked. I followed this answer and it worked :)

What I had to do was change the #import SomeFile.h to #import <SomeFile.h> by using the brackets instead.

Here is the code from each file

Inside the NBRegExMatcher.m file I had to change these 2 modules:

//#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>

After I changed those I also got the same error inside the NBPhoneNumberUtil.m and had to do the same there:

//#import "NBRegExMatcher.h" // comment this out and add the brackets below
#import <NBRegExMatcher.h>

Here are pictures of each:

NBRegExMatcher.m file
enter image description here

NBPhoneNumberUtil.m file
enter image description here

On a side note I also had to add the pod 'libPhoneNumber-iOS', '~> 0.8' to my Podfile because a different error appeared because I used the library outside of the FlagPhoneNumber pod

@grifas grifas closed this as completed Dec 4, 2019
@jakubradzik
Copy link

I have the same issue and I can't just edit .m files because therefore this code is not committed to GitHub and CI system won't let the commit pass through build checks. Is there any other way to fix this issue?

xCode version - 11.3.1

@lsamaria
Copy link
Contributor Author

lsamaria commented Jun 5, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants