react-native-unimodules icon indicating copy to clipboard operation
react-native-unimodules copied to clipboard

The "UMNativeModulesProxy" native module is not exported through NativeModules; verify that @unimodules/react-native-adapter's native code is linked properly

Open sriteja777 opened this issue 4 years ago • 10 comments

This is for React Native version 0.62. The issue occurs in this repo (https://github.com/brentvatne/testwithsixtwo) on Android.

First, when the app is built and launched on the device, app launches fine, but when we close the app and launch it from the App Drawer, then this issue occurs. This issue makes debugging difficult as every time we need to start the build again.

Reproducible demo

  1. Clone the repo (https://github.com/brentvatne/testwithsixtwo)
  2. Run yarn install; react-native start and react-native run-android
  3. Now the app launches and works fine on the device.
  4. Now close the app (also from background) on the device
  5. Open the app again from the App Drawer, you will get this error.

sriteja777 avatar Jul 15 '20 09:07 sriteja777

Bizarrely enough I'm having this appear in a console.warn when I run my jest tests, (rn version: 0.63.2, running in expo bare-workflow) the app runs fine on simulators/physical devices, so it doesn't hinder me as much as make it just really annoying to read my test output - don't supposed there was ever any resolution to this?

kieran-osgood avatar Sep 26 '20 13:09 kieran-osgood

Bizarrely enough I'm having this appear in a console.warn when I run my jest tests, (rn version: 0.63.2, running in expo bare-workflow) the app runs fine on simulators/physical devices, so it doesn't hinder me as much as make it just really annoying to read my test output - don't supposed there was ever any resolution to this?

same with me

MetaMmodern avatar Oct 21 '20 14:10 MetaMmodern

Getting same issue here when running my Jest tests. Anyone found any solutions for the warning?

ahummel25 avatar Nov 12 '20 19:11 ahummel25

Getting same error when running Jest tests.

teja-kandula avatar Nov 18 '20 09:11 teja-kandula

For those getting this warning in your tests -- make sure you're using the jest-expo preset if you aren't already.

Also, if you're:

  1. using jest-expo >40.0.1 and
  2. applying both jest-expo/jest-preset and react-native/jest-preset in your jest config in an Object.assign fashion, like so:
const expoPreset = require("jest-expo/jest-preset");
const jestPreset = require("react-native/jest-preset");

module.exports = Object.assign(expoPreset, jestPreset, {
    // additional config
});

...then you need to stop doing 2 and only apply jest-expo:

const expoPreset = require("jest-expo/jest-preset");

module.exports = Object.assign(expoPreset, {
    // additional config
});

Long story short, jest-expo changed its logic from mutating react-native/jest-preset directly to overriding a copy of react-native/jest-preset. Before that change, applying the react-native/jest-preset on top of jest-expo was basically a no-op because it was just the same mutated object. After the change, this made it so that all of the jest-expo overrides were being wiped out by the original react-native/jest-preset.

jarredt avatar Dec 30 '20 00:12 jarredt

Getting same issue here. Anyone looking into this?

max-md avatar Jan 12 '21 10:01 max-md

Same problem here using bare workflow. The issue appeared when added expo-font module

yarn add expo-font

bogdan-marian avatar Apr 17 '21 07:04 bogdan-marian

I'm running into the same thing with Jest tests as well. Has anyone found a solution?

KrisLau avatar Jun 25 '21 17:06 KrisLau

Same issue; I can't get my app to run at all with this issue. In my case it's followed by

ERROR  TypeError: null is not an object (evaluating 'NativeUnimoduleProxy.viewManagersNames')
ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. 
      This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. 
      This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.

nibblesnbits avatar Aug 04 '21 19:08 nibblesnbits

I figured out what was causing the problem in my application but it's very strange. It looks like it was cause by importing the method from an index file with a bunch of other methods in it like this:

// utils/index.js
export {validateEmail as validateEmail} from './input-validation';
export {validatePassword as validatePassword} from './input-validation';

so I just changed the import in the test files from import {validatePassword} from '../src/utils' to import {validatePassword} from '../src/utils/input-validation'

KrisLau avatar Aug 06 '21 14:08 KrisLau