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

Problem installing pods #7

Closed
sclavijo93 opened this issue Jan 17, 2022 · 8 comments
Closed

Problem installing pods #7

sclavijo93 opened this issue Jan 17, 2022 · 8 comments

Comments

@sclavijo93
Copy link
Contributor

sclavijo93 commented Jan 17, 2022

Hi, I was trying to test the library in my project but I'm getting and error when running npx pod-install. I'm getting the following error:

Downloading dependencies
Installing react-native-money (1.0.1)
[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `react-native-money` depends upon `React-RCTText`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

Is it something related specifically to the library or something I have to do with my project?

@NathHorrigan
Copy link
Collaborator

Hi @sclavijo93,

I haven't seen this issue before,

Do you have swift enabled on your React Native project?

@sclavijo93
Copy link
Contributor Author

Hi @NathHorrigan. Yes, we have it enabled. We also have some native native modules implemented in Swift.

@NathHorrigan
Copy link
Collaborator

What does your Podfile look like @sclavijo93?

@sclavijo93
Copy link
Contributor Author

This is 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, '10.0'

project 'myApp',
        'Prod.Debug' => :debug,
        'Prod.Release' => :release,
        'QA.Debug' => :debug,
        'QA.Release' => :release,
        'Debug' => :debug,
        'Release' => :release

target 'myApp' do

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  pod 'Permission-Contacts', :path => "#{permissions_path}/Contacts"
  pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"


  pod 'RNFS', :path => '../node_modules/react-native-fs'

  target 'OneSignalNotificationServiceExtension' do
    pod 'OneSignal', '>= 2.9.3', '< 5.0'
  end

  pod 'Firebase/Crashlytics'

  # add the Firebase pod for Google Analytics
  pod 'Firebase/Analytics'
  # add pods for any other desired Firebase products
  # https://firebase.google.com/docs/ios/setup#available-pods

  # React Native Maps dependencies
  rn_maps_path = '../node_modules/react-native-maps'
  pod 'react-native-google-maps', :path => rn_maps_path
  pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

  pod 'react-native-onesignal', :path => '../node_modules/react-native-onesignal'

  target 'myAppTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  # use_flipper!
  # use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1' })
  use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0', 'Flipper-RSocket' => '1.3.1', configurations: ['Debug', 'Prod.Debug', 'QA.Debug'] })

  post_install do |installer|
    react_native_post_install(installer)

    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
      end
    end
  end

end

@NathHorrigan
Copy link
Collaborator

Thanks @sclavijo93,

If you add the following under above the pod 'react-native-onesignal' line does it help?

pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text', :modular_headers => true

@sclavijo93
Copy link
Contributor Author

Sure, I'll give it a try!

@sclavijo93
Copy link
Contributor Author

Thanks @NathHorrigan , Honestly, I don't know what that code snippet does, but it works. Unfortunately, I don't have much experience in iOS development.

Thanks!

@NathHorrigan
Copy link
Collaborator

I'm glad we could fix it, I'll make sure to add it to the README!

That snippet imports the native TextComponent from the React Native library with the header files exposed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants