Skip to content
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

React-native-geolocation-service failing when building on xcode it says "underlying Objective-C module 'react_native_geolocation_service' not found", "failed to verify module interface of 'react_native_geolocation_service' due to the errors above; the textual interface may be broken" #420

Open
dexiouz opened this issue Aug 18, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@dexiouz
Copy link

dexiouz commented Aug 18, 2023

Environment

Run npx react-native info in your terminal and copy the results here.
System:
OS: macOS 13.4
CPU: (10) arm64 Apple M1 Pro
Memory: 94.75 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
Yarn: 1.22.19 - ~/Documents/activeCode/BUDPAY/budpay/node_modules/.bin/yarn
npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm
Watchman: 2023.06.08.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.12.1 - /Users/chideraugwuanyi/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.10121639
Xcode: 14.3/14E222b - /usr/bin/xcodebuild
Languages:
Java: 11.0.19 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.8 => 0.71.8
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Platforms

Is this issue related to Android, iOS, or both ?
iOS ( when building on xcode )

Versions

Please add the used versions/branches

  • Android:
  • iOS:
  • react-native-geolocation-service: 5.3.1
  • react-native: 0.71.8
  • react: 18.2.0

Description

I get this error when building on xcode after installation

  • "failed to verify module interface of 'react_native_geolocation_service' due to the errors above; the textual interface may be broken" ,
  • "underlying Objective-C module 'react_native_geolocation_service' not found".
Screenshot 2023-08-18 at 17 10 14

Reproducible Demo

Provide a detailed list of steps that reproduce the issue.

  1. Set up react native project
  2. Disable flipper in iOS podfile
  3. Install react native geolocation service follow the instructions on the installation page
  4. Build with Xcode "Run"

Expected Results

Build should be successful

My podfile

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios,"12.4"
prepare_react_native_project!

If you are using a react-native-flipper your iOS build will fail when NO_FLIPPER=1 is set.

because react-native-flipper depends on (FlipperKit,...) that will be excluded

To fix this you can also exclude react-native-flipper using a react-native.config.js

```js

module.exports = {

dependencies: {

...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),

```

flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled

linkage = ENV['USE_FRAMEWORKS']

if linkage != nil

Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green

use_frameworks! :linkage => linkage.to_sym

end

target 'budpay' do
config = use_native_modules!

Flags change depending on the env values.

flags = get_default_flags()

use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => flags[:hermes_enabled],
# :fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
# :flipper_configuration => flipper_config,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
use_frameworks!
end

dynamic_frameworks = ['Socket.IO-Client-Swift', 'Starscream', 'iProov', 'DatadogSDK']
pre_install do |installer|
installer.pod_targets.each do |pod|
if !dynamic_frameworks.include?(pod.name)
puts "Overriding the static_framework? method for #{pod.name}"
def pod.static_framework?;
true
end
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
end
end
end
sed -i -e $'s/__IPHONE_10_0/__IPHONE_13_0/' #{installer.sandbox.root}/RCT-Folly/folly/portability/Time.h
end

@dexiouz dexiouz added the bug Something isn't working label Aug 18, 2023
@dexiouz dexiouz changed the title React-native-geolocation=service failing when building on xcode it says "underlying Objective-C module 'react_native_geolocation_service' not found", "failed to verify module interface of 'react_native_geolocation_service' due to the errors above; the textual interface may be broken" React-native-geolocation-service failing when building on xcode it says "underlying Objective-C module 'react_native_geolocation_service' not found", "failed to verify module interface of 'react_native_geolocation_service' due to the errors above; the textual interface may be broken" Aug 18, 2023
@talha-arshad-temedica
Copy link

Did you find any solution?

@dexiouz
Copy link
Author

dexiouz commented Nov 16, 2023

Did you find any solution?

No not yet. Are you experiencing the same issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants