After updating React native to 0.69.8 got following error - android

ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.
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.
"react-native": "0.69.8",

Related

Problem using react-native-track-player with a custom dev client

I get this error when I try to use react-native-track-player in expo
TypeError: null is not an object (evaluating ‘TrackPlayer.RATING_HEART’)
Invariant Violation: “main” has not been registered. This can happen if:
*** Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.**
*** A module failed to load due to an error and AppRegistry.registerComponent wasn’t called.**
I deployed using expo-dev-client
Would you know what could be the problem?

Android release build crash - Doesn't find the shared module from yarn workspaces monorepo

I am using monorepo created using Yarn Workspaces which has a react-native project (mobile folder) and a common folder which contains the common files to be shared across projects. Here the mobile project is dependent on common files.
The Android app runs fine in debug mode. When I run in release mode, it crashes as soon as it opens. I am getting the below error.
E/ReactNativeJS: 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.
--------- beginning of crash
2022-06-07 23:48:09.865 5772-5799/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
Process: com.myapp.mobile, PID: 5772
com.facebook.react.common.JavascriptException: TypeError: t is not a function. (In 't(u)', 't' is undefined), stack:
<unknown>#460:2846
map#-1
<unknown>#460:2825
N#457:7733
<unknown>#455:172
h#2:1585
<unknown>#453:262
h#2:1585
<unknown>#403:148
h#2:1585
<unknown>#6:57
h#2:1585
d#2:958
global code#529:3
at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:72)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loop(Looper.java:223)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
at java.lang.Thread.run(Thread.java:923)
While researching about this, I came across this suggestion and tired it. Found out that the functions which I import from common is causing this error. It is present in node_modules but not sure whether it is getting packed into the bundle or not.
Mobile's package.json:
Any Suggestions?
I think you should change the import flow the way you are importing the package in your package.json file.
See the example below of the react-native-image-crop-picker importing the library in their example code.
And the library code is in the same parent directory.

EAS Build (Android) .apk Crashes, Expo Build .apk Runs Correctly

I'm updating a React Native app to EAS Build, after using expo build for several years. The app works via the development server.
After running eas build, the .apk file builds successfully, but immediately crashes when opened on a device.
My error log is:
TypeError: undefined is not an object (evaluating 't.indexOf')
Running "main" with {"rootTag":1}
Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
Has anyone run into this error?
I also had problems, but after reading the documentation some things changed.
Are you migrating an Expo managed app from "expo build"? Learn about the differences.
They must create an index file (reference), with:
import { registerRootComponent } from 'expo';
import App from './src/App';
registerRootComponent(App);
(If the App.js is in the root, delete the /src so they have ./App)
And then, from the package.json, delete the entire line of main.
And [this is the most difficult step]
(https://docs.expo.dev/build-reference/migrating/#metroconfigjs--must-export-the-entire-default
, it cost me
i have the same problem
Invariant Violation: "main" has not been registered. This can happen if:
Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
A module failed to load due to an error and AppRegistry.registerComponent wasn't called.

React Native - App Registry not registered module and Undefined NavigationTabs Error - Top Navigator Tutorial

Hello I tried following this tutorial (
https://www.javatpoint.com/react-native-create-material-top-tab-navigator)
to create a top tab navigator but I am getting these errors.
TypeError: undefined is not a function (near '...(0, _reactNavigationTabs.default)...')
And
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
I have tried restarting and my emulator, and changing the import statements but still no luck.
I tried searching for solutions online but the errors are still there.
I am a complete beginner, please help? I am running an android emulator and using vs code.

Reactnative V63+ Invariant Violation: TurboModuleRegistry.getEnforcing(...)

Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'LinkingManager' could not be found. Verify that a module by this name is registered in the native binary
Somewhere at code you used = instead of === for platform check. I also faced the same issue.

Categories

Resources