Recently, i'm deep into my project, totally focused, when suddenly, I stumble upon this warning message that says, "Import of module 'glog.glog.log_severity' appears within namespace 'google' warn statusconsolelistener the use of package scanning to locate plugins is deprecated and will be removed in a future release in react native"

In React Native, trying to build something awesome, when out of nowhere, this warning about package scanning being deprecated hits me like a ton of bricks.

Basically, it's telling me that the way I'm importing a module is a bit outdated and might cause problems down the road. It's like a little red flag waving in my code, warning me that I need to update my methods to keep things running smoothly.

In this blog post, I'm diving deep into this error and discussing possible solutions. From updating my import methods to exploring alternative approaches,


Import of module 'glog.glog.log_severity' appears within namespace 'google' warn statusconsolelistener the use of package scanning to locate plugins is deprecated and will be removed in a future release

The error "Import of module 'glog.glog.log_severity' appears within namespace 'google'," it indicates a problem with the import statement related to the 'glog' module within the 'google' namespace.

To resolve this issue, I would suggest checking the following:

  1. Ensure that the 'glog' module is installed in your Python environment. You can do this by running:
pip install glog
  1. Verify that you are importing the 'glog' module correctly. It should be imported as follows:
import glog
  1. If you are importing specific components from 'glog,' make sure you are using the correct syntax. For example:
from glog import log_severity
  1. Check if there are any naming conflicts with the 'google' namespace. If possible, try renaming the 'google' namespace or the conflicting module.

By following these steps, you should be able to resolve the import error related to 'glog.glog.log_severity' appearing within the 'google' namespace.

Error: 'import of module 'glog.glog.log_severity' appears within namespace 'google'' on xcode with react-native
We added the following snippet, ensuring to include the modular_headers part:

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

This code allowed us to specify the glog library's podspec path and set modular_headers to false, essentially telling CocoaPods not to use modular headers for glog.

It definitely did the trick and got our project back on track, which is a relief. However, we can't ignore the fact that we're bypassing a feature that could potentially improve how our project handles dependencies.

By opting out of modular headers, we might be missing out on optimizations and future enhancements that could benefit our project in the long run. So, while this fix solved our immediate issue, we'll keep an eye out for alternative solutions or updates.

Only include the glog library in our dependencies

We decided to get specific and only include the glog library in our dependencies. we used the use_modular_headers flag and set it to false. This basically tells CocoaPods not to use modular headers for the glog library.

Our Podfile looked something like this:

use_modular_headers!

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

And you know what? It did the trick! . By setting modular_headers to false, we're essentially bypassing a feature that could potentially improve the way our project handles dependencies. 

So, while this solution saved the day for us, we'll definitely keep an eye out for any updates or improvements that could make our project more robust in the future.