react-native-background-geolocation: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_TSBackgroundFetch", referenced from: objc-class-ref in TSLocationManager(TSLocationManager.o)


[UPDATE]: See solution here re: use_frameworks!


Your Environment

  • Platform: iOS
  • OS version:12.2
  • Device manufacturer / model: iPhone X
  • React Native version (react-native -v): 0.58.5
  • Plugin config

Expected Behavior

Project should compile

Actual Behavior

On build, error thrown: Undefined symbols for architecture x86_64: “OBJC_CLASS$_TSBackgroundFetch”, referenced from: objc-class-ref in TSLocationManager(TSLocationManager.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Steps to Reproduce

  1. Follow Pod Install instructions (including react-native link cocoa-lumberjack)
  2. Attempt to build
  3. Suffer

Context

Build the project.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 33 (20 by maintainers)

Most upvoted comments

$ cd ios
$ rm Podfile.lock
$ pod install

Show me the entire output of running pod install

Did you:

$ cd ios
$ pod install

?

Actually, let’s try a trick I learned from my flutter version.

Manually edit the react-native-background-geolocation .podspec: node_modules/react-native-background-geolocation/RNBackgroundGeolocation.podspec

.
.
.
Pod::Spec.new do |s|
  .
  .
  .
+s.static_framework = true
end
$ cd ios
$ pod install

Adding s.static_framework = true to background-geolocation.podspec should allow it to work with use_frameworks!

  • Do an XCode -> Product -> Clean
  • Restart XCode.