Crash on Android phone with expo, react Native and firebase - android

I'm doing an app in react Native, Expo and Firebase.
I've got some crash when i test it on an Android phone.
I recently use Test Lab from firebase to test my app and I've got this error:
Your app uses 4 non-SDK interfaces, which are incompatible with Android P+.
this is my package.json:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"android": {
"versionCode": 2
},
"dependencies": {
"#eva-design/eva": "^2.0.0",
"#react-native-async-storage/async-storage": "github:react-native-async-storage/async-storage",
"#react-native-firebase/app": "^8.4.2",
"#react-native-firebase/storage": "^7.4.3",
"#react-navigation/native": "^5.7.3",
"#react-navigation/stack": "^5.9.0",
"#sentry/react-native": "^2.4.3",
"#ui-kitten/components": "^5.0.0",
"expo": "^41.0.0",
"expo-av": "~9.1.2",
"expo-constants": "~10.1.3",
"expo-device": "~3.2.0",
"expo-firebase-analytics": "~4.0.2",
"expo-linear-gradient": "~9.1.0",
"expo-localization": "~10.1.0",
"expo-notifications": "~0.11.6",
"firebase": "8.2.3",
"hermes-engine": "^0.8.0",
"lottie-react-native": "3.5.0",
"moment": "^2.29.1",
"native-base": "^2.15.0",
"npm": "^7.14.0",
"react": "16.13.1",
"react-instantsearch-native": "^6.10.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"react-native-gesture-handler": "~1.10.2",
"react-native-hyperlink": "0.0.19",
"react-native-paper": "^4.1.0",
"react-native-read-more-text": "^1.1.2",
"react-native-screens": "~3.0.0",
"react-native-svg": "12.1.0",
"rxjs": "^7.1.0"
},
"devDependencies": {
"#babel/core": "~7.9.0",
"babel-preset-expo": "8.3.0"
},
"private": true
}
If someone know if I use an package that not compatible ore something like that
(The app in prod crash too)

Related

React Native Expo App not building aab and apk on expo

i have getting the build error when i make build of my project
after running this command eas build for android aab and apk everything goes riht but when it goes to Gradlew it gives errors
here is the Run Gradlew error below
Run Gradlew Error
and here is my package.json
{
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"#react-native-async-storage/async-storage": "~1.17.3",
"#react-native-community/masked-view": "0.1.10",
"#react-native-masked-view/masked-view": "^0.2.8",
"#react-navigation/bottom-tabs": "^5.11.7",
"#react-navigation/drawer": "^5.12.3",
"#react-navigation/native": "^5.9.2",
"#react-navigation/stack": "^5.14.2",
"deprecated-react-native-prop-types": "^4.0.0",
"expo": "~47.0.12",
"expo-app-loading": "~2.1.1",
"expo-asset": "~8.7.0",
"expo-auth-session": "~3.8.0",
"expo-crypto": "~12.0.0",
"expo-font": "~11.0.1",
"expo-linear-gradient": "~12.0.1",
"expo-random": "~13.0.0",
"expo-splash-screen": "~0.17.5",
"expo-status-bar": "~1.4.2",
"expo-updates": "~0.15.6",
"hex-to-rgba": "^2.0.1",
"lodash": "^4.17.20",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-native": "0.70.5",
"react-native-device-info": "^8.0.1",
"react-native-dropdown-picker": "^5.4.4",
"react-native-easy-grid": "^0.2.2",
"react-native-gesture-handler": "~2.8.0",
"react-native-htmlview": "^0.16.0",
"react-native-image-zoom-viewer": "^3.0.1",
"react-native-linear-gradient": "^2.6.2",
"react-native-map-clustering": "^3.4.2",
"react-native-maps": "1.3.2",
"react-native-paper": "^4.7.1",
"react-native-reanimated": "~2.12.0",
"react-native-render-html": "^6.3.4",
"react-native-responsive-fontsize": "^0.5.0",
"react-native-safe-area-context": "4.4.1",
"react-native-screens": "~3.18.0",
"react-native-super-grid": "^4.1.0",
"react-native-touchable-scale": "^2.1.2",
"react-native-vector-icons": "^8.0.0",
"react-native-web": "~0.18.7"
},
"devDependencies": {
"#babel/core": "^7.19.3"
},
"private": true,
"name": "RealBeez",
"version": "1.0.0"
}

react-native-webview android issue: Found interface com.facebook.react.uimanager.events.EventDispatcher, but class was expected

I am using react-native-webview for my react native app which has the rn version 0.64.4,
But I cannot open screen when we have a web view in it, the app get crash immediately. this is only happening on the android. Then I open up the android project via android studio, then I could see the below error on the log. How can I fix this issue?
Error log:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xapp, PID: 21712
java.lang.IncompatibleClassChangeError: Found interface com.facebook.react.uimanager.events.EventDispatcher, but class was expected (declaration of 'com.facebook.react.uimanager.events.EventDispatcher' appears in /data/app/~~qPom7HPfdYNLFEMUio836A==/com.verime-gQSY9JQLtB6GGgsqfvIrFg==/base.apk!classes3.dex)
at com.reactnativecommunity.webview.RNCWebViewManager.dispatchEvent(RNCWebViewManager.java:168)
at com.reactnativecommunity.webview.RNCWebViewManager$RNCWebChromeClient.onProgressChanged(RNCWebViewManager.java:1153)
at la.handleMessage(chromium-TrichromeWebViewGoogle6432.aab-stable-530410534:278)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8751)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
This is my package.json
{
"name": "xapp",
"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 .",
"np": "np --no-publish",
"postversion": "react-native-version",
"build:ios": "react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios",
"postinstall": "patch-package"
},
"dependencies": {
"#react-native-async-storage/async-storage": "^1.17.10",
"#react-native-community/art": "^1.2.0",
"#react-native-community/checkbox": "^0.5.7",
"#react-native-community/datetimepicker": "^3.4.1",
"#react-native-community/picker": "^1.8.1",
"#react-native-firebase/app": "^11.0.0",
"#react-native-firebase/messaging": "^11.0.0",
"#react-native-picker/picker": "^2.4.8",
"#react-navigation/bottom-tabs": "^5.5.2",
"#react-navigation/native": "^5.6.1",
"#react-navigation/stack": "^5.5.1",
"#woonivers/react-native-document-scanner": "^2.1.1",
"axios": "^0.21.1",
"base-64": "^0.1.0",
"install": "^0.13.0",
"lottie-react-native": "^5.1.4",
"moment": "^2.27.0",
"native-base": "^2.15.2",
"npm": "^7.20.5",
"pdf-lib": "^1.10.0",
"radio-buttons-react-native": "^1.0.4",
"react": "17.0.1",
"react-native": "0.64.4",
"react-native-biometrics": "^3.0.1",
"react-native-blob-util": "^0.15.0",
"react-native-camera": "^3.30.0",
"react-native-circular-progress": "^1.3.7",
"react-native-contacts": "^7.0.2",
"react-native-device-info": "^8.0.1",
"react-native-document-picker": "^5.0.3",
"react-native-floating-action": "^1.21.0",
"react-native-fs": "^2.16.6",
"react-native-gesture-handler": "^1.10.3",
"react-native-image-crop-picker": "^0.36.2",
"react-native-image-picker": "^3.3.2",
"react-native-image-progress": "^1.1.1",
"react-native-image-resizer": "^1.2.6",
"react-native-image-to-pdf": "^1.2.0",
"react-native-image-tools-wm": "^1.5.8",
"react-native-invoke-app": "^1.0.6",
"react-native-jitsi-meet": "^2.2.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-keychain": "^7.0.0",
"react-native-linear-gradient": "^2.6.2",
"react-native-masked-text": "^1.13.0",
"react-native-modal-datetime-picker": "^9.2.0",
"react-native-paper": "^3.10.1",
"react-native-pdf": "^6.2.0",
"react-native-pdf-lib": "^1.0.0",
"react-native-permissions": "^3.0.5",
"react-native-perspective-image-cropper": "git+https://github.com/kmwi/react-native-perspective-image-cropper.git",
"react-native-progress": "^4.1.2",
"react-native-reanimated": "^1.9.0",
"react-native-rectangle-scanner": "^1.0.10",
"react-native-safe-area-context": "^3.0.5",
"react-native-screens": "^2.9.0",
"react-native-select-multiple": "^2.1.0",
"react-native-signature-canvas": "4.4.1",
"react-native-simple-radio-button": "^2.7.4",
"react-native-simple-toast": "^1.1.2",
"react-native-snackbar": "^2.4.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-status-bar-height": "^2.6.0",
"react-native-svg": "git+https://github.com/expo/react-native-svg.git",
"react-native-tooltips": "^1.0.3",
"react-native-user-avatar": "^1.0.8",
"react-native-vector-icons": "^7.0.0",
"react-native-view-pdf": "^0.11.0",
"react-native-virtual-keyboard": "^1.1.0",
"react-native-walkthrough-tooltip": "^1.3.1",
"react-native-webview": "11.18.1",
"react-navigation": "^4.3.9",
"react-navigation-drawer": "^2.4.13",
"react-navigation-stack": "^2.7.0",
"react-redux": "^7.2.0",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-persist": "^6.0.0",
"redux-saga": "^1.1.3"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"jetifier": "^2.0.0",
"metro-react-native-babel-preset": "^0.64.0",
"np": "^7.6.1",
"patch-package": "^6.5.0",
"postinstall-postinstall": "^2.1.0",
"react-native-version": "^4.0.0",
"react-test-renderer": "17.0.1",
"reactotron-react-native": "^5.0.0",
"reactotron-redux": "^3.1.3",
"reactotron-redux-saga": "^4.2.3"
},
"jest": {
"preset": "react-native"
}
}
Similar case here, the libraries involved are invertase/react-native-apple-authentication and react-native-webview. They suddenly started crashing due to a Kotlin version difference, after correcting them, react-native-reanimated started giving a similar error as yours, but instead of expecting a class, it expects interface, the other way around.
Found class com.facebook.react.uimanager.events.EventDispatcher, but interface was expected.
at com.swmansion.reanimated.NodesManager.(NodesManager.java:116)
UPDATE: I just resolved my problem, it was due to a library trying to use a newer version of react native, and I ended upgrading my project to RN 64.
Since RN 64, the EventDispatcher.java file in the react-native project changed a lot, from class in 63.5 to a interface in 64. Your issue could be that a library is trying to use older RN version and is expecting a class, but your RN version already works with Interface regarding that file.
Hope it helps you, good luck!

Caused by: java.lang.Exception: Command `config` unrecognized

After Running Copied React-native project:
Caused by: java.lang.Exception: Command config unrecognized. Make sure that you have run npm install and that you are inside a react-native project.
I did npm install but it didn't help.
Package.json
{
"name": "ProjectName",
"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 .",
"postinstall": "node ./scripts/stfu.js"
},
"dependencies": {
"#invertase/react-native-apple-authentication": "^0.1.1",
"#philly25/react-native-paytm": "^1.0.12",
"#react-native-community/datetimepicker": "^2.2.1",
"#react-native-community/google-signin": "^3.0.4",
"#react-native-community/masked-view": "^0.1.6",
"#react-native-community/netinfo": "^5.3.3",
"#react-native-community/push-notification-ios": "^1.0.6",
"fuse.js": "^3.4.6",
"lottie-react-native": "^3.3.2",
"moment": "^2.24.0",
"react": "16.12.0",
"react-native": "^0.61.5",
"react-native-action-button": "file:./custom_modules/react-native-action-button",
"react-native-android-sms-listener": "^0.7.0",
"react-native-calendar-picker": "file:./custom_modules/react-native-calendar-picker",
"react-native-calendars": "file:./custom_modules/react-native-calendars",
"react-native-carousel-view": "file:./custom_modules/react-native-carousel-view",
"react-native-chart-kit": "file:./custom_modules/react-native-chart-kit",
"react-native-fbsdk": "^1.1.2",
"react-native-fetch-polyfill": "^1.1.3",
"react-native-firebase": "^5.6.0",
"react-native-fs": "^2.16.2",
"react-native-gesture-handler": "^1.5.6",
"react-native-google-drive-api-wrapper": "^1.2.0",
"react-native-google-fit": "^0.9.17",
"react-native-google-signin": "^2.1.1",
"react-native-image-pan-zoom": "^2.1.11",
"react-native-image-picker": "^2.3.0",
"react-native-modal": "^11.5.3",
"react-native-modal-datetime-picker": "^8.1.3",
"react-native-options-menu": "^2.0.2",
"react-native-otp-input": "file:./custom_modules/react-native-otp-input",
"react-native-popup-menu": "^0.15.7",
"react-native-push-notification": "^3.1.9",
"react-native-raw-bottom-sheet": "^2.0.6",
"react-native-reanimated": "^1.7.0",
"react-native-render-html": "^4.2.0",
"react-native-responsive-dimensions": "^3.0.0",
"react-native-restart": "0.0.13",
"react-native-safe-area-context": "^0.6.4",
"react-native-screens": "^2.0.0-beta.1",
"react-native-select-input-ios": "file:./custom_modules/react-native-select-input-ios",
"react-native-simple-toast": "^1.0.0",
"react-native-size-matters": "^0.3.0",
"react-native-slideable-calendar-strip": "file:./custom_modules/react-native-slideable-calendar-strip",
"react-native-snap-carousel": "^3.8.4",
"react-native-svg": "^11.0.1",
"react-native-swipe-gestures": "^1.0.4",
"react-native-swipe-list-view": "^2.1.3",
"react-native-tag-select": "file:./custom_modules/react-native-tag-select",
"react-native-vector-icons": "^6.6.0",
"react-native-webview": "^8.0.6",
"react-navigation": "^4.1.1",
"react-navigation-stack": "^2.1.0",
"react-navigation-tabs": "^2.7.0",
"realm": "^4.0.0-beta.0"
},
"devDependencies": {
"#babel/core": "7.8.4",
"#babel/runtime": "7.8.4",
"#react-native-community/eslint-config": "^0.0.5",
"eslint": "^6.5.1",
"babel-jest": "25.1.0",
"jest": "25.1.0",
"metro-react-native-babel-preset": "0.58.0",
"react-test-renderer": "16.12.0"
},
"jest": {
"preset": "react-native"
},
"rnpm": {
"assets": [
"./app/res/fonts/"
]
}
}
Sharing image:
Running npm install from the project folder PFA.
https://i.stack.imgur.com/YcYvz.png

React Native 0.60.4 / couldn't find DSO to load: libhermes.so on Firebase Test Lab

I have got this error at startup ONLY when testing my react native app on Firebase Test Lab (Robo)
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
Tested on several devices with different API, it works only on API 21 and 22. Curiously, the app passes all the tests on the Play Store Prelaunch Report.
Actually the most surprising is that I do not use hermes but JSC. The error appears only when I upload an aab (gradlew bundleRelease). It goes well when I upload an universal apk (gradlew assembleRelease).
Here is my package.json
{
"name": "",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-native-community/netinfo": "^4.1.4",
"#redux-offline/redux-offline": "^2.5.2-native.0",
"buffer": "^5.4.2",
"hermes-engine": "^0.2.1",
"jsc-android": "^241213.1.0",
"prop-types": "^15.7.2",
"react": "16.8.6",
"react-native": "0.60.4",
"react-native-animatable": "^1.3.2",
"react-native-bootsplash": "^0.1.1",
"react-native-device-info": "^3.0.1",
"react-native-elements": "^1.1.0",
"react-native-extended-stylesheet": "^0.12.0",
"react-native-firebase": "^5.5.6",
"react-native-fs": "^2.14.1",
"react-native-navigation": "^3.1.2",
"react-native-offline": "^4.3.0",
"react-native-render-html": "^4.1.2",
"react-native-smooth-pincode-input": "^1.0.7",
"react-native-svg": "^9.9.3",
"react-native-svg-charts": "^5.3.0",
"react-native-timer": "^1.3.6",
"react-native-uuid": "^1.4.9",
"react-native-vector-icons": "^6.6.0",
"react-redux": "^7.1.0",
"redux": "^4.0.4",
"redux-logger": "^3.0.6",
"redux-persist": "^5.10.0",
"redux-saga": "^1.0.5"
},
"devDependencies": {
"#babel/core": "7.5.5",
"#babel/runtime": "7.5.5",
"#react-native-community/eslint-config": "0.0.3",
"babel-jest": "24.8.0",
"eslint": "6.1.0",
"jest": "24.8.0",
"metro-react-native-babel-preset": "0.54.1",
"react-test-renderer": "16.8.6",
"redux-devtools-extension": "^2.13.8"
},
"jest": {
"preset": "react-native"
}
}
Thanks for your help.

React native app crashes when destroying the app, only on Android

When destroying the app, the app crashes with a com.facebook.react.bridge.NoSuchKeyException. This is exclusive to Android. The crash happens with both debug and release builds.
I have tried updating all of my packages, which did not fix the issue. I believe this is likely caused by a third party library, but I'm not sure how to track it down with the information I have.
Stack trace:
com.facebook.react.bridge.NoSuchKeyException lineNumber
ReadableNativeMap.java:124 com.facebook.react.bridge.ReadableNativeMap.getValue
ReadableNativeMap.java:128 com.facebook.react.bridge.ReadableNativeMap.getValue
ReadableNativeMap.java:182 com.facebook.react.bridge.ReadableNativeMap.getInt
JSStackTrace.java:28 com.facebook.react.util.JSStackTrace.format
ExceptionsManagerModule.java:46 com.facebook.react.modules.core.ExceptionsManagerModule.reportSoftException
Method.java:-2 java.lang.reflect.Method.invoke
JavaMethodWrapper.java:372 com.facebook.react.bridge.JavaMethodWrapper.invoke
JavaModuleWrapper.java:158 com.facebook.react.bridge.JavaModuleWrapper.invoke
NativeRunnable.java:-2 com.facebook.react.bridge.queue.NativeRunnable.run
Handler.java:873 android.os.Handler.handleCallback
Handler.java:99 android.os.Handler.dispatchMessage
MessageQueueThreadHandler.java:29 com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage
Looper.java:193 android.os.Looper.loop
MessageQueueThreadImpl.java:232 com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run
Thread.java:764 java.lang.Thread.run
package.json:
{
"name": "rnkirsofficer",
"version": "2.0.0",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"version": "react-native-version"
},
"dependencies": {
"#mapbox/polyline": "^1.0.0",
"#react-native-community/async-storage": "^1.3.3",
"#react-native-community/netinfo": "^2.0.4",
"aws-amplify": "^1.1.26",
"aws-amplify-react-native": "^2.1.10",
"bugsnag-react-native": "^2.16.0",
"fuse.js": "^3.4.4",
"haversine": "^1.1.1",
"moment": "^2.24.0",
"native-base": "^2.12.1",
"prop-types": "^15.7.2",
"react": "16.8.3",
"react-native": "0.59.4",
"react-native-background-geolocation": "^3.0.1",
"react-native-calendars": "^1.32.0",
"react-native-gesture-handler": "^1.1.0",
"react-native-gifted-chat": "^0.7.2",
"react-native-google-maps-directions": "^2.0.0",
"react-native-maps": "^0.24.2",
"react-native-maps-super-cluster": "^1.5.0",
"react-native-popup-menu": "^0.15.5",
"react-native-svg": "^9.4.0",
"react-native-svg-charts": "^5.2.0",
"react-native-text-ticker": "^0.14.0",
"react-native-version-number": "^0.3.5",
"react-navigation": "^3.8.1",
"react-redux": "^6.0.1",
"react-timeout": "^1.2.0",
"redux": "^4.0.1",
"redux-devtools-extension": "^2.13.8",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"uuid": "^3.3.2"
},
"devDependencies": {
"#babel/core": "7.3.4",
"#babel/runtime": "7.3.4",
"babel-jest": "24.5.0",
"husky": "^1.3.1",
"jest": "24.5.0",
"metro-react-native-babel-preset": "0.53.1",
"react-native-version": "^3.0.0",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}
I expect the app to be able to be destroyed without crashing, but currently it crashes with a NoSuchKeyException.
Well,
Check if you have use Console.err() somewhere in your project.
If so remove those Console.err().

Categories

Resources