Native application closes as soon as it is launched

0
Hello experts,   I am working on a pluggable widget. After adding the widget to my native application and running it on the “Make it Native 9” application, it is working fine however, when I generate a .apk file from the Build Native Mobile App, the application gets installed BUT  as soon as I launch the application, it closes immediately. I get a pop-up error saying “the app keeps stopping”. As per this forum question: https://forum.mendix.com/link/questions/98738   I opened the application on android studio and ran it on the emulator. Below is the logcat  logs 2022-08-30 15:37:18.332 9810-9849/com.mendix.nativetemplate 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. 2022-08-30 15:37:18.415 9810-9850/com.mendix.nativetemplate E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules Process: com.mendix.nativetemplate, PID: 9810 com.facebook.react.common.JavascriptException: Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null. To fix this issue try these steps: • Run `react-native link @react-native-community/async-storage` in the project root. • Rebuild and restart the app. • Run the packager with `--reset-cache` flag. • If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. • If this happens while testing with Jest, check out docs how to integrate AsyncStorage with it: https://react-native-community.github.io/async-storage/docs/advanced/jest If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-async-storage/issues , stack: <unknown>@419:180 h@2:1585 <unknown>@418:217 h@2:1585 <unknown>@417:324 h@2:1585 <unknown>@7:1118 h@2:1585 <unknown>@6:35 h@2:1585 d@2:958 global code@1047:3 at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:83) 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:151) 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:226) at java.lang.Thread.run(Thread.java:923)   Also When I  run the command provided in the logs related to  async storage I get the following error: D:\apps\V 2\fem-master\fem-master>react-native link @react-native-community/async-storage warn Package @react-native-community/async-storage has been ignored because it contains invalid configuration. Reason: Cannot find module '@react-native-community\async-storage\package.json' Require stack: - D:\apps\V 2\fem-master\fem-master\node_modules\react-native\node_modules\@react-native-community\cli\build\tools\config\resolveNodeModuleDir.js - D:\apps\V 2\fem-master\fem-master\node_modules\react-native\node_modules\@react-native-community\cli\build\tools\releaseChecker\index.js - D:\apps\V 2\fem-master\fem-master\node_modules\react-native\node_modules\@react-native-community\cli\build\commands\start\runServer.js - D:\apps\V 2\fem-master\fem-master\node_modules\react-native\node_modules\@react-native-community\cli\build\commands\start\start.js - D:\apps\V 2\fem-master\fem-master\node_modules\react-native\node_modules\@react-native-community\cli\build\commands\index.js - D:\apps\V 2\fem-master\fem-master\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js - D:\apps\V 2\fem-master\fem-master\node_modules\react-native\cli.js  
asked
0 answers