1

I am having some issues when migrating to Gradle 7 and I got a few errors at the runtime. My build is getting successful but cannot be redirected to the ”Login Screen”. As such, the issue is basically raised from the NPM package that creates an issue while migrating.

Java Version:

JDK Version: 11

Android Versions:

Gradle Version: 7.2
Gradle Plugin Version: 4.2.2

buildToolsVersion = '30.0.2'
supportLibVersion = '30.0.2'

minSdkVersion = 26
compileSdkVersion = 31
targetSdkVersion = 30

kotlin_version = '1.6.0'

React Native Versions:

"react": "^18.2.0",
"react-dom": "^18.2.0",

"react-native": "0.68.0",
"react-native-flipper": "^0.153.0",

"react-native-reanimated": "^1.13.4",

"expo": "^44.0.0",

Root cause of the issue:

Error message:

ERROR TypeError: (0, _expoModulesCore.requireNativeModule) is not a function. (In '(0, _expoModulesCore.requireNativeModule)('ExpoCrypto')', '(0, _expoModulesCore.requireNativeModule)' is undefined) LOG Running "TestApp" with {"rootTag":1} ERROR Invariant Violation: "TestApp" 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.

Note:

  • I have gone through many documents and URLs for a better understanding and applied a few steps as per the requirements.
  • But there are no specific steps that are given anywhere to migrate to Gradle 7, not even in the React Native or Facebook community’s forum page.

Screenshot:

Expo Package Error

James Z
  • 12,209
  • 10
  • 24
  • 44
Parth Bhayani
  • 1,894
  • 3
  • 17
  • 35

0 Answers0