React-native: import of module 'glog.glog.log_severity' appears within namespace 'google'

Created on 27 Aug 2019  路  12Comments  路  Source: facebook/react-native

I've faced with the following problem (https://github.com/google/glog/issues/393)
Using RN for an SDK, created a pod file. The pod install works well, but during the xcode's build process i get the following error message.

Screenshot at Aug 27 14-43-57

I assume the problem caused by the swift 5.x version, i've never met this error before.

Environment

React Native version:
react-native-cli: 2.0.1
react-native: 0.60.5
pod version: 1.8.0.beta.1
osx 10.15 Beta (19A536g)
Xcode 11.0 beta 5 (11M382q)
Toolchain: Swift 5.1 Snapshot 2019-07-25 (a)

My pod file

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

platform :ios, '9.0'
use_frameworks!

target 'XXXXX' do

  pod 'React', :path => '../../js/node_modules/react-native/'
  pod 'React-Core', :path => '../../js/node_modules/react-native/React'
  pod 'React-DevSupport', :path => '../../js/node_modules/react-native/React'
  pod 'React-RCTText', :path => '../../js/node_modules/react-native/Libraries/Text'
  pod 'React-RCTImage', :path => '../../js/node_modules/react-native/Libraries/Image'
  pod 'React-RCTNetwork', :path => '../../js/node_modules/react-native/Libraries/Network'
  pod 'React-RCTWebSocket', :path => '../../js/node_modules/react-native/Libraries/WebSocket'
  pod 'React-RCTLinking', :path => '../../js/node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTAnimation', :path => '../../js/node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../../js/node_modules/react-native/Libraries/Blob'
  pod 'React-RCTLinking', :path => '../../js/node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTActionSheet', :path => '../../js/node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTSettings', :path => '../../js/node_modules/react-native/Libraries/Settings'
  pod 'React-RCTVibration', :path => '../../js/node_modules/react-native/Libraries/Vibration'
  pod 'React-cxxreact', :path => '../../js/node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../../js/node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../../js/node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../../js/node_modules/react-native/ReactCommon/jsinspector'

  pod 'DoubleConversion', :podspec => '../../js/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec', :modular_headers => false
  pod 'glog', :podspec => '../../js/node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false
  pod 'Folly', :podspec => '../../js/node_modules/react-native/third-party-podspecs/Folly.podspec', :modular_headers => false

  pod 'yoga', :path => '../../js/node_modules/react-native/ReactCommon/yoga'
  pod 'react-native-camera', subspecs: ['RCT', 'RN'], path: '../../js/node_modules/react-native-camera'
  pod 'react-native-image-picker', :path => '../../js/node_modules/react-native-image-picker'
  pod 'rn-fetch-blob', :path => '../../js/node_modules/rn-fetch-blob'
  pod 'react-native-image-resizer', :path => '../../js/node_modules/react-native-image-resizer'
  pod 'react-native-orientation', :path => '../../js/node_modules/react-native-orientation'
  pod 'RNDeviceInfo', :path => '../../js/node_modules/react-native-device-info'
  pod 'RNGestureHandler', :path => '../../js/node_modules/react-native-gesture-handler'
end

Bug Stale

Most helpful comment

This solved it for me using use_modular_headers!:

pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec', :modular_headers => false

All 12 comments

Same on non-beta XCode 10.3 and 0.61.rc-2

Same on 0.59.10 release? 馃槩

Same on 0.59.10 release? 馃槩

Meanwhile, I need to use use_modular_headers!

Same issue here.

Same here. Tried to upgrade from 0.57.x to 60.x

In my case I unlinked all libraries with react-native unlink and added all to pods one by one to solve the issue.

Same on 0.59.10 release? 馃槩

Meanwhile, I need to use use_modular_headers!

i use_modular_headers! . due to https://github.com/react-native-community/lottie-react-native/issues/511

In my case I unlinked all libraries with react-native unlink and added all to pods one by one to solve the issue.

not worked . do you commented use_modular_headers! ?
by commenting this ,i face with

```
The following Swift pods cannot yet be integrated as static libraries:

The Swift pod lottie-react-native depends upon React, 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.


"react": "16.8.3",
"react-native": "0.59.10",
"lottie-ios": "^3.0.3",
"lottie-react-native": "^3.1.1",
```

This solved it for me using use_modular_headers!:

pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec', :modular_headers => false

Same on 0.59.10 release? 馃槩

Meanwhile, I need to use use_modular_headers!

i use_modular_headers! . due to react-native-community/lottie-react-native#511

I'm in the exact position as you, did you solve it?

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Was this page helpful?
0 / 5 - 0 ratings