The global "__expo" and "Expo" objects will be removed in SDK 41.

Please provide the following:

  1. SDK Version:40
  2. Platforms(Android/iOS/web/all): Android/iOS

Hi there, I am getting this warning after upgrading to Expo 40:

Your project is accessing the following APIs from a deprecated global rather than a module import: Constants (expo-constants).
The global “__expo” and “Expo” objects will be removed in SDK 41. Learn more about how to fix this warning: https://expo.fyi/deprecated-globals

I did a quick search and found many discussions about, but I can’t get rid of it. Is anyone willing to assist?

I have already tried to hide it and to update some libraries (such as react-native-paper) to no avail. I would rather fix it than hiding it.

Thanks in advance.

Hey @dariocostanzo, does searching for __expo in your project and/or the node_modules folder yield any results? If not and you are still seeing this warning, try clearing your caches and see if that resolves it.

Cheers,
Adam

I got this a couple of weeks ago in a project that was using react-native-paper 4.4.1. I think at the time, expo install was installing that version.

$ grep '__expo\>' ./node_modules/react-native-paper/src/constants.ts
const expo = global.__expo;

If I currently run expo install react-native-paper in that project, it gets upgraded to 4.5.0 which no longer references __expo.

Many thanks @wodin and @adamjnav, I started by installing expo-constants as suggested here to no avail, than I solved it yesterday by upgrading react-native-paper to 4.5.0

Someone has suggested that also SafeAreaView is triggering the warning, and got rid of the message by importing it from ‘react-native-safe-area-context’ rather than ‘react-native’, I haven’t had this issue, so I can’t give more details.

I know this is too much to expect, but I would have loved to have the logs showing where the issue was, as I am not super experienced and took me 2 days to figure it out, which I can’t really afford as I have deadlines, but fortunately it is sorted now.