react-native-geolocation icon indicating copy to clipboard operation
react-native-geolocation copied to clipboard

Build Error on Xcode (iOS) error build: Undefined symbol: _OBJC_CLASS_$_CLLocationManager

Open ceyanesb opened this issue 3 years ago • 1 comments

Environment

    OS: macOS 12.6
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 773.88 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.0/bin/yarn
    npm: 8.3.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
    Watchman: 2022.02.07.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
    Android SDK:
      API Levels: 23, 28, 29, 30, 31, 32
      Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 32.0.0, 33.0.0
      System Images: android-28 | Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64, android-29 | Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64, android-30 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7935034
    Xcode: 14.0/14A309 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.8 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.67.4 => 0.67.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Platforms

For now I've tried in Xcode (for iOS), haven't tried on android

Versions

  • iOS: 15.0
  • react-native-geolocation: 3.0.1
  • react-native: 0.67.4
  • react: 17.0.2
  • xcode: 14.0

Description

After installing react-native-firebase and disabling flipper the library didn't let me build the app. Xcode gives me this error Screen Shot 2022-09-14 at 1 03 53 PM

Reproducible Demo

For reproducing this demo just try to build the app from xcode and it will fail

ceyanesb avatar Sep 14 '22 17:09 ceyanesb

Hey, I just tested with a fresh RN 0.67.4 project + Xcode 14 and it builds well. You mentioned that it's failing after adding firebase - could you provide me with a minimal repro project/list of deps that led to this issue?

michalchudziak avatar Sep 19 '22 08:09 michalchudziak

same issue

anhnh-yoong avatar Sep 24 '22 03:09 anhnh-yoong

It seems that you're building this module as a framework (use_frameworks!) in the Podfile. I will work on a fix soon but need to do some testing around it. The potential fix would be to patch the library's .podspec and add:

s.frameworks = 'CoreLocation'

alternatively, you might force building this module as a static lib with the following script in the Podfile

  pre_install do |installer|
    installer.pod_targets.each do |pod|
      if pod.name.eql?('react-native-geolocation')
        def pod.build_type
          Pod::BuildType.static_library
        end
      end
    end
  end

michalchudziak avatar Sep 25 '22 17:09 michalchudziak

Shipped in 3.0.2

michalchudziak avatar Oct 11 '22 13:10 michalchudziak