New warning UIManager[‘getConstants’] on SDK 34 for Android

Expo diagnostics:

  Expo CLI 3.0.10 environment info:
    System:
      OS: macOS High Sierra 10.13.6
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.16.0 - /usr/local/opt/node@10/bin/node
      npm: 6.9.0 - ~/.npm-global/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      expo: ^34.0.3 => 34.0.4 
      react: 16.8.3 => 16.8.3 
      react-native: https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz => 0.59.8 
      react-navigation: ^3.11.1 => 3.12.0 
    npmGlobalPackages:
      expo-cli: 3.0.10

Issue description:

After update SDK 33 to 34 appear a new warning on launch the app:

Accessing view manager configs directly off UIManager via UIManager[‘getConstants’] is no longer supported. Use UIManager.getViewManagerConfig(‘getConstants’) instead.

Stack:

- node_modules/expo/build/environment/muteWarnings.fx.js:17:23 in warn

- node_modules/react-native/Libraries/ReactNative/UIManager.js:164:12 in get

- node_modules/react-native/Libraries/Utilities/defineLazyObjectProperty.js:42:18 in getValue

- node_modules/react-native-gesture-handler/createHandler.js:39:2 in <unknown>

- node_modules/metro/src/lib/polyfills/require.js:330:6 in loadModuleImplementation

- node_modules/react-native-gesture-handler/NativeViewGestureHandler.js:3:0 in <unknown>

- node_modules/metro/src/lib/polyfills/require.js:330:6 in loadModuleImplementation

- node_modules/react-native-gesture-handler/createNativeWrapper.js:3:0 in <unknown>

- node_modules/metro/src/lib/polyfills/require.js:330:6 in loadModuleImplementation

- node_modules/react-native-gesture-handler/GestureHandler.js:1:0 in <unknown>

- node_modules/metro/src/lib/polyfills/require.js:330:6 in loadModuleImplementation

- node_modules/react-native-gesture-handler/Swipeable.js:10:0 in <unknown>

- node_modules/metro/src/lib/polyfills/require.js:330:6 in loadModuleImplementation

- node_modules/react-native-gesture-handler/index.js:1:0 in <unknown>

- node_modules/metro/src/lib/polyfills/require.js:330:6 in loadModuleImplementation

- node_modules/react-navigation-stack/lib/module/views/StackView/StackViewLayout.js:1:1762 in <unknown>

- node_modules/metro/src/lib/polyfills/require.js:330:6 in loadModuleImplementation

- node_modules/react-navigation-stack/lib/module/views/StackView/StackView.js:1:1417 in <unknown>

- node_modules/metro/src/lib/polyfills/require.js:330:6 in loadModuleImplementation

- node_modules/react-navigation-stack/lib/module/navigators/createStackNavigator.js:1:166 in <unknown>

- node_modules/metro/src/lib/polyfills/require.js:330:6 in loadModuleImplementation

- node_modules/react-navigation-stack/lib/module/index.js:1:35 in <unknown>

- node_modules/metro/src/lib/polyfills/require.js:330:6 in loadModuleImplementation

- node_modules/react-navigation/src/react-navigation.js:124:18 in createStackNavigator

* src/navigation/component/index.js:97:17 in <unknown>

- node_modules/metro/src/lib/polyfills/require.js:330:6 in loadModuleImplementation

* App.js:10:0 in <unknown>

- node_modules/metro/src/lib/polyfills/require.js:330:6 in loadModuleImplementation

- node_modules/expo/AppEntry.js:4:0 in <unknown>

- node_modules/metro/src/lib/polyfills/require.js:330:6 in loadModuleImplementation

- node_modules/metro/src/lib/polyfills/require.js:196:45 in guardedLoadModule

* null:null in global code

Has anyone else found it? Does anyone know the reason?

Regards,

4 Likes

I didn’t get this type of Warning. but when i was checking the solution for this problem. i got an solution. Did you even try this??

https://github.com/RepairShopr/react-native-signature-capture/issues/157

Hello I’ve got the same exact problem. I’m still trying to get a solution.

Any progress on a solution for this warning? I’m facing the same issue

Same problem here

Try downgrading react-native-gesture-handler to ‘1.3.0’.

3 Likes

Did that work for you? had this problem since yesterday and I tried downgrading react-native-gesture-handler to ‘1.3.0’. And it didn’t change anything on my end

If you are using expo, after the downgrade use: expo r -c

4 Likes

I have used react-native-gesture-handler@1.3.0 since I upgrade. It does not seem the problem.

1 Like

I have reviewed all references to UIManager[name] in the project code and I don’t know where the problem is coming from, it seems that all calls are well discriminated by version (RN < 0.58 and RN >= 0.58).

I’m still looking for…

I can confirm this workaround is working, please be sure you are downgrading correctly, you could use this line in package.json to choose exactly that version.

"react-native-gesture-handler": "~1.3.0"

if you choose the package version with “^” and you are cleaning your node_modules, npm will upgrade to the latest version (1.4.1) when you are doing npm install

3 Likes

Many thanks for this.

My package.json was:
"react-native-gesture-handler": "^1.3.0"

And then to:
"react-native-gesture-handler": "~1.3.0"

Changing from caret to tilde fixed it.

5 Likes

This, this right here. Thank you so much

3 Likes

The problem is that some of the dependencies in the project seem not to be compatible with the version of react-native-gesture-handler v1.4.1. So downgrading to version 1.3.0 works. Post up for Close.:wink:

3 Likes

-c flag do the magic!! you save my day!

2 Likes

Works for me! :slight_smile: