question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android v0.65.1] Fresh install gives NativeUIManager.getConstantsForViewManager('Text') error while debugging

See original GitHub issue

Description

Trying to create a new project with the the latest stable version of both RN and RN CLI throws this error when Debug mode is enabled:

NativeUIManager.getConstantsForViewManager('Text') threw an exception. Invariant Violation: Calling synchronous methods on native modules is not supported in Chrome.

 Consider providing alternative methods to expose this method in debug mode, e.g. by exposing constants ahead-of-time. 
App@http://10.0.2.2:8081/App.bundle?platform=android&app=com.testa&modulesOnly=true&dev=true&minify=false&runModule=true&shallow=true:18:54
RCTView
View
RCTView
View
AppContainer@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.testa&modulesOnly=false&runModule=true:75604:36
RootComponentWithMeaningfulName@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.testa&modulesOnly=false&runModule=true:82460:24

Even if you just render a single View component with a Text inside WITH styling, it will throw the error. IF you remove the style prop from the Text component then the error is gone.

React Native version:

16:08:49 ~/code/testa $ react-native info
info Fetching system and libraries information...
System:
    OS: Linux 5.10 Arch Linux
    CPU: (16) x64 Intel(R) Core(TM) i9-9900 CPU @ 3.10GHz
    Memory: 341.81 MB / 15.55 GB
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 16.7.0 - /usr/bin/node
    Yarn: 1.22.11 - /usr/bin/yarn
    npm: 7.20.6 - /usr/bin/npm
    Watchman: 4.9.0 - /home/linuxbrew/.linuxbrew/bin/watchman
  SDKs:
    Android SDK:
      API Levels: 16, 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0
      System Images: android-28 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.7199119
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.65.1 => 0.65.1
  npmGlobalPackages:
    *react-native*: Not Found
16:08:57 ~/code/testa $

Steps To Reproduce

  1. run react-native init testa
  2. start the app(run yarn start and yarn android
  3. Enable debug mode

Expected Results

Not throw any error

Snack, code example, screenshot, or link to a repository:

image

import React from 'react';
import {Text, View} from 'react-native';

const App = () => {
  return (
    <View>
      <Text style={{backgroundColor: 'red'}}>Hello</Text>
    </View>
  );
};

export default App;

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:13
  • Comments:29 (2 by maintainers)

github_iconTop GitHub Comments

17reactions
Mi36commented, Sep 16, 2021

Is there any solution other than downgrade?

10reactions
mikehardycommented, Sep 28, 2021

@shinken008 +1 comments are useless in practice and just add notifications noise to people trying to solve root causes. Please do not post them. Use a reaction (thumbs-up) in the future, thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Chrome Debugger Error: NativeUIManager ...
My question is how can I fix the error while keeping the style in the component Text. I saw that chrome has a...
Read more >
Android Debug Bridge (adb) - Android Developers
Android Debug Bridge ( adb ) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a...
Read more >
Issues · facebook/react-native · GitHub - amd-drivers.org
[Android v0.65.1] Fresh install gives NativeUIManager.getConstantsForViewManager('Text') error while debugging Needs: Triage Resolution: Locked This ...
Read more >
Debugging - React Native
Accessing the In-App Developer Menu. ... when your app is running in the iOS Simulator, or ⌘M when running in an Android emulator...
Read more >
[Android] Upgrading to RN 0.65.1 then in the Android emulator ...
Open the debugger in the Android emulator causes error: ... NativeUIManager.getConstantsForViewManager('getConstants') threw an exception.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found