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

import of module 'glog.glog.log_severity' appears within namespace 'google' #393

Closed
imRanjit opened this issue Nov 21, 2018 · 15 comments
Closed

Comments

@imRanjit
Copy link

Hello All,
I am running iOS project using react-native. I have installed pods, below is my Podfile

_source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/goinstant/pods-specs-public'

target ‘appName’ do
platform :ios, '9.0'
use_modular_headers!

pod 'GoogleSignIn'
pod 'GoogleMaps'    

pod 'React', :path => './node_modules/react-native', :subspecs => [
'Core',
'RCTText',
'RCTImage',
'RCTNetwork',
'CxxBridge',
'RCTLinkingIOS',
'RCTWebSocket',
'RCTAnimation',
'DevSupport',
pod 'yoga', :path => './node_modules/react-native/ReactCommon/yoga'
post_install do |installer|
    installer.pods_project.targets.each do |target|
        phase_name = 'Headers'
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '3.0'
        end
    end
end
pod 'ReactNativeLocalization", :path => './node_modules/react-native-localization'
pod 'BVLinearGradient', :path => './node_modules/react-native-linear-gradient'
pod 'DoubleConversion', :podspec => './node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => './node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => './node_modules/react-native/third-party-podspecs/Folly.podspec'

end_

So when I run my project, I get the above error. Please let me know how to fix this.

@sergiud
Copy link
Collaborator

sergiud commented Nov 21, 2018

What's a pod? How is your problem related to glog?

@imRanjit
Copy link
Author

Hi @sergiud , pod is dependency manager used to install and update 3rd party dependencies. Its related to glog because, this error is happening in glog/logging.h file

@sergiud
Copy link
Collaborator

sergiud commented Nov 21, 2018

Please then provide a minimal example allowing to reproduce the problem, without pod.

@khloukrada
Copy link

khloukrada commented Dec 15, 2018

I also have the same issue on line 512 of glog/logging.h
`namespace google {

// They need the definitions of integer types.
#include "glog/log_severity.h"
#include "glog/vlog_is_on.h"`
Is there any solution?

@amrita019
Copy link

@sergiud
As per mentioned in the docs
I added Folly in my podfile, and then this issue appeared in logging.h

@sergiud
Copy link
Collaborator

sergiud commented Dec 31, 2018

I'm neither familiar with Folly nor with pod. Please provide a reproducible standalone example showcasing the problem. Closing the issue until then.

@sergiud sergiud closed this as completed Dec 31, 2018
@Legonaftik
Copy link

@imRanjit I have the same issue. Looks like it's required to include "use_frameworks!" in your Podfile for Swift projects to make React Native work.
Look in the docs: https://facebook.github.io/react-native/docs/integration-with-existing-apps
Switch between Objective-C and Swift guides and notice that "use_frameworks!" is stated for Swift but not for Objective-C.

So for now I have to use "use_frameworks!" and do not use "use_modular_headers!" which means to use dynamically linked frameworks instead of static ones :(

@makadaw
Copy link

makadaw commented Feb 21, 2019

Try to turn off module imports for this pods

pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec', :modular_headers => false
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

@anutripa
Copy link

Is there a solution without using use_Frameworks!

@Teivaz
Copy link

Teivaz commented Aug 14, 2019

@anutripa Try updating cocoapods.
I've checked this question on StackOverflow and checked my version of pods. In 1.5.3 I was still getting this error but after updating to 1.7.5 it is no longer required and you can remove use_frameworks! / use_modular_headers!

P.S. @sergiud sorry for hijacking this thread with seemingly unrelated issue. The point of failure was in the glog here where includes were inside the namespace. The swift <==> objC bridge was trying to generate "modular_headers" for that and chocked on that syntax which brought us all here. Hopefully this is not a problem any more.

@kovacs-tamas
Copy link

This issue is still exists, why did you close it?
i can't use the RN because i receive the following error message.

Screenshot at Aug 27 14-43-57

OS: 10.15 Beta (19A536g)
Xcode: 11.0 beta 5 (11M382q)
Toolchain: Swift 5.1 Snapshot 2019-07-25 (a)

React-Native: 0.60.5 (glog version in podspec file is 0.3.5)

@kovacs-tamas
Copy link

kovacs-tamas commented Aug 27, 2019

Other infos
Pod version: 1.8.0.beta.1

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

platform :ios, '9.0'
use_frameworks!

target 'eportrait_sdk' 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```

So, i tried everything what i found on the internet, but i think these steps don't change the original problem :)

@kovacs-tamas
Copy link

Is the glog prepared for Clang 11.0.0? I assume the problem can be a deprecated syntax, because i haven't faced with this issue before i upgraded to Catalina beta

@sagarjeu
Copy link

sagarjeu commented Jul 1, 2022

Add same in pod file
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
still issue

#include "glog/log_severity.h"
#include "glog/vlog_is_on.h"
logging file
errro: Import of module 'glog.glog.log_severity' appears within namespace 'google'

@sergiud sergiud added the invalid label Jul 1, 2022
@sergiud
Copy link
Collaborator

sergiud commented Jul 1, 2022

I'm locking the discussion because the issue is clearly not in glog but rather is caused by the tools being used.

@google google locked as off-topic and limited conversation to collaborators Jul 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants