The react-native android App is running on emulator, but not on device.
The app is syncing perfect and showing no build errors.
I tried removing libraries, de-linking, re-linking again, cleaning android app, Invalidating cache and restart, clearing react native cache and using npm install again. A lot of things. Adding more permissions to the Androidmanifest.xml file. But actually, none of them is working.
While debugging through Android Studio, no issue. Just the app is stuck on the splash screen after passing through all the break points in MainApplication and MainActivity.
Libraries used in the project :
package.json file :
{
"name": "xyz",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"firebase": "^7.2.1",
"react": "16.9.0",
"react-native": "0.61.2",
"react-native-freshchat-sdk": "^2.1.1",
"react-native-gesture-handler": "^1.4.1",
"react-native-onesignal": "^3.4.2",
"react-native-screens": "^2.0.0-alpha.3",
"react-native-splash-screen": "^3.2.0",
"react-native-vector-icons": "^6.6.0",
"react-native-webview": "^7.4.0",
"react-navigation": "^4.0.10",
"react-navigation-drawer": "^2.2.2",
"react-navigation-stack": "^1.9.4",
"react-navigation-tabs": "^2.5.6"
},
"devDependencies": {
"@babel/core": "7.6.2",
"@babel/runtime": "7.6.2",
"@react-native-community/eslint-config": "0.0.3",
"babel-jest": "24.9.0",
"eslint": "6.5.0",
"jest": "24.9.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
Error :
BUILD SUCCESSFUL in 52s
156 actionable tasks: 11 executed, 145 up-to-date info Connecting to the development server... info Starting the app on "device"... Starting: Intent { cmp=com.xyz/.MainActivity } java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference at android.os.Parcel.readException(Parcel.java:1552) at android.os.Parcel.readException(Parcel.java:1499) at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:2663) at com.android.commands.am.Am.runStart(Am.java:766) at com.android.commands.am.Am.onRun(Am.java:305) at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) at com.android.commands.am.Am.main(Am.java:97) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249)
Expecting it to run on Android device as well, but it's not running.