0

I want to stop using use_frameworks! so my dependencies are linked statically. As I know, one way to solve No such module 'ModuleName' error in this case is to add use_modular_headers! in Podfile.

The problem is that use_modular_headers! brings another error. Is there a way to avoid both use_frameworks! and use_modular_headers!?

  • CocoaPods: 1.5.3
  • Xcode: 10.1
  • Swift: 4.0

Podfile:

source 'https://github.com/CocoaPods/Specs.git'

plugin 'cocoapods-fix-react-native'

platform :ios, '11.0'
inhibit_all_warnings!

pod 'RxSwift'
pod 'RxCocoa'

target 'AppName' do
  pod 'RxDataSources'
  pod 'R.swift'
  pod 'Kingfisher'
  pod 'KDEAudioPlayer', :git => 'https://github.com/delannoyk/AudioPlayer.git', :branch => 'master'
  pod 'Firebase/Performance'
  pod 'Firebase/Core'
  pod 'Firebase/RemoteConfig'
  pod 'Firebase/Messaging'
  pod 'Fabric'
  pod 'Crashlytics'
  pod 'GoogleMaps'
  pod 'VIMVideoPlayer'
  pod 'ReachabilitySwift'
  pod 'React', :podspec => '../../react/external/React.0.54.4.podspec.json', :subspecs => [
    'Core',
    'cxxreact',
    'DevSupport',
    'fishhook',
    'RCTLinkingIOS',
    'RCTWebSocket',
    'RCTVibration',
    'RCTText',
    'RCTSettings',
    # Contains deprecated UIKit stuff...
    # 'RCTPushNotification',
    'RCTNetwork',
    'RCTImage',
    'RCTGeolocation',
    'RCTBlob',
    'RCTAnimation',
    'RCTActionSheet',
    'ART',
    'PrivateDatabase',
    'jsinspector',
    'jschelpers',
    'CxxBridge'
  ]
  pod 'yoga', :podspec => '../../react/external/yoga.0.54.4.podspec.json'
  pod 'Folly', :podspec => '../react/node_modules/react-native/third-party-podspecs/Folly.podspec'
  pod 'glog', :podspec => '../react/node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'react-native-video', :path => '../react/node_modules/react-native-video/react-native-video.podspec'

end

2 Answers 2

1

The CocoaPods 1.6.0 pre-release may fix the problem with use_modular_headers!.

If not and you can provide enough information to reproduce, please file a CocoaPods issue.

Sign up to request clarification or add additional context in comments.

Comments

0

I found a solution even it's doesn't look to good/scalable.

Instead of using use_modular_headers! option we can import classes we using via BridgingHeader. What you need to do is to add BridgingHeader.h file in your Swift project an import all the headers you need. The file will look like this:

// These are imported manually to avoid using 'use_modular_headers!' option in Podfile.
// 'use_modular_headers!' leads to error with 'glog' dependency.
import <VIMVideoPlayer/VIMVideoPlayer.h>
import <VIMVideoPlayer/VIMVideoPlayerView.h>
import <React/RCTBridge.h>
import <React/RCTRootView.h>
import <React/RCTBundleURLProvider.h>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.