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>
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 installin/iosdir.
but no success. I’ve also checked that:
- I’ve run
yarn add react-native-background-geolocationandyarn 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)
To resolve this on react-native 0.61 i had to also manually run
yarn install react-native-background-fetchSo… I uninstalled the libs again.
But now after uninstalling I noticed that this
RNBackgroundFetch+AppDelegate.mfile and the.frameworkfile 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.mfile 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-autoIt’s the full wipe…
Don’t know. Uninstall both plugins and re-install.