react-native-background-geolocation: 'TSBackgroundFetch/TSBackgroundFetch.h' file not found

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?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

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

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.

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

It’s the full wipe…

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