Skip to content

'TSBackgroundFetch/TSBackgroundFetch.h' file not found #902

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

Closed
nene opened this issue Nov 18, 2019 · 18 comments
Closed

'TSBackgroundFetch/TSBackgroundFetch.h' file not found #902

nene opened this issue Nov 18, 2019 · 18 comments

Comments

@nene
Copy link

nene commented Nov 18, 2019

Your Environment

  • Plugin version: 3.3.2
  • Platform: iOS
  • OS version: MacOS 10.15.1
  • Device manufacturer / model: Apple
  • React Native version: 0.61.4
  • Plugin config: Don't think it matters

Expected Behavior

Able to build without errors.

Actual Behavior

Build fails with error:

..../node_modules/react-native-background-fetch/ios/RNBackgroundFetch/RNBackgroundFetch+AppDelegate.m:11:9: fatal error: 'TSBackgroundFetch/TSBackgroundFetch.h' file not found
#import <TSBackgroundFetch/TSBackgroundFetch.h>

Screen Shot 2019-11-18 at 16 35 40

Steps to Reproduce & Context

I was upgrading my app from react-native 0.59.9 to 0.61.4

Followed the steps in https://github.com/transistorsoft/react-native-background-geolocation/blob/master/help/INSTALL-IOS-AUTO.md

Although I'm confused about the addition of RNBackgroundFetch+AppDelegate.m file. When I looked into adding it, I discovered that the file was already there. I removed and re-added it, but the error remained the same.

Found some other issues with the same title, tried to follow the devide suggested there:

  • made sure I've run pod install in /ios dir.

but no success. I've also checked that:

  • I've run yarn add react-native-background-geolocation and yarn add react-native-background-fetch
  • The build fails both when executed from command line (react-native run-ios) or through Xcode.

Debug logs

I suspect logs will only matter after I get the app running? Or would you like to see the full log of a build?

@christocracy
Copy link
Member

$ cd ios
$ pod install

@nene
Copy link
Author

nene commented Nov 18, 2019

I've done this several times already. But doesn't help.

@christocracy
Copy link
Member

Terminate XCode and restart.

@nene
Copy link
Author

nene commented Nov 18, 2019

Restarted Xcode. But build still fails.

@christocracy
Copy link
Member

Don't know. Uninstall both plugins and re-install.

@nene
Copy link
Author

nene commented Nov 18, 2019

OK. I'll give it a try...

@nene
Copy link
Author

nene commented Nov 18, 2019

Nope. Still fails exactly as before. :(

@christocracy
Copy link
Member

$ cd ios
$ rm -rf Pods
$ rm Podfile.lock
$ pod install

@mikehardy
Copy link
Contributor

My magic trick for these is npx react-native-clean-project clean-project-auto

It's the full wipe...

@nene
Copy link
Author

nene commented Nov 18, 2019

So... I uninstalled the libs again.

But now after uninstalling I noticed that this RNBackgroundFetch+AppDelegate.m file and the .framework file are still handing around in Xcode. So I removed them from there manually.

After reinstalling the libs, it's now successfully building.

I didn't re-add the RNBackgroundFetch+AppDelegate.m file after installing as the installation guide is suggesting. Not sure if I should worry about this or not? (Perhaps it means that I'm simply no more actually including this lib to my project - no code, no errors).

But at least it's building now. Can't yet say if it's fully working as now I have some other errors from other libs to sort out on my way of upgrading react-native.

But thanks for all the help.

@nene
Copy link
Author

nene commented Nov 19, 2019

Yep. Looks like the lib is not only compiling but working as well. All good then.

@nene nene closed this as completed Nov 19, 2019
@bolandrm
Copy link

bolandrm commented Feb 5, 2020

To resolve this on react-native 0.61 i had to also manually run yarn install react-native-background-fetch

@christocracy
Copy link
Member

@bolandrm thats precisely what the iOS Setup directs you to do, no?

@bolandrm
Copy link

bolandrm commented Feb 5, 2020

Ah yes, I missed that.

@RishavGoswami
Copy link

RishavGoswami commented Jun 30, 2020

I was stuck on this error for two days straight, tried everything that's been told but nothing worked until I realize to check my Xcode version. Turned out, I had Xcode v10. Just make sure before doing any other things, you have Xcode v11.5 and above. Then

cd ios
rm -rf Pods
rm -rf Podfile.lock
pod install

@christocracy
Copy link
Member

Always use latest XCode.

@blwinters
Copy link

@bolandrm thats precisely what the iOS Setup directs you to do, no?

@christocracy I missed this part too. I think the formatting of that doc could be improved slightly so that it's clear on first glance that there are 2 packages to install. Maybe add a line after the first install command (both Yarn and NPM) to the effect of:

"Then, install the appropriate version of react-native-background-fetch:"

@defiantgoat
Copy link

For anyone else finding this issue, I had to specifically add the headers to my Targets Frameworks, Libraries and Embedded Content
Screenshot 2023-05-04 at 9 10 50 AM

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

7 participants