Closed koukoujohn closed 2 years ago
It would be helpful if you could provide a reproduction that I could clone and try on my end - your description makes it look like it could very well be a bug in dev-client
Same issue, and I do also have Stripe and Sentry. Just upgraded to SDK 45, EAS.
I open the dev client app, and it crashes even before showing up the menu. Never had it before.
I will try to remove Sentry and build again, but Stripe could also be causing it.
I hadn't Sentry before the SDK 45 upgrade.
I had an issue with Stripe >=0.2.4 when I used SDK 44: https://forums.expo.dev/t/change-targetsdkversion-for-stripe-react-native-0-2-4/62534/6?u=srbrahma, maybe it and/or other related issues haven't been fixed in SDK 45.
My package.json:
Edit1: Removing Sentry didn't fix it. Tomorrow will downgrade Stripe and try again.
Edit2: Downgraded Stripe to 0.2.3 and it's now working. @ajsmth take a look into the link I mentioned here.
@ajsmth I'm sorry but I can't provide a better repro than: create an expo dev client build with my dependencies listed above and test on an Android 10 device/emulator. I haven't found what combination of dependencies is causing this crash on dev app start yet.
I have a suspicion that also reanimated/gesturehandler is involved in the crash along with Stripe.
I am saying that because when the app tries to open, I see an animation like react navigation is trying to open a new screen(!!) multiple times but it fails. And then the app crashes completely after a few seconds. Sometimes it crashes immediately.
But the error is always the same from stacktrace:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my-app/expo.modules.devlauncher.launcher.errors.DevLauncherErrorActivity}: java.lang.NullPointerException
Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.
The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.
A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.
"How to narrow down the source of an error"
You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this manual debugging guide to learn how to isolate the problem from the rest of your codebase.
That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.
This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.
Summary
Dev app builds with no issues for Android but crashes immediately on Android 10 device on load without even having the chance to show the dev menu.
If I remove stripe-react-native 0.6.1 completely or roll it back to the expo 44 compatible version which was 0.2.3, and create a new dev build, the app loads normally.
There is no issue with production build though, the crash happens only on the dev client and Android 10 physical device.
On android 12 emulated device everything works ok.
I know this is a very specific error, has anyone seen this error below before? Or has a suggestion for a config plugin that would temporarily fix it
Managed or bare workflow? If you have made manual changes inside of the
ios/
orandroid/
directories in your project, the answer is bare!managed
What platform(s) does this occur on?
Android
Package versions
"@eva-design/eva": "2.0.0", "@expo/react-native-action-sheet": "^3.6.0", "@intercom/intercom-react-native": "^3.0.3", "@react-native-async-storage/async-storage": "~1.17.3", "@react-native-community/masked-view": "0.1.10", "@react-native-community/netinfo": "8.2.0", "@sentry/react-native": "^3.4.2", "@stripe/stripe-react-native": "0.6.1", "@ui-kitten/components": "^5.1.0", "@ui-kitten/eva-icons": "^5.0.0", "apisauce": "^1.0.2", "config-plugin-react-native-intercom": "^1.4.0", "expo": "^45.0.4", "expo-apple-authentication": "~4.2.1", "expo-application": "~4.1.0", "expo-asset": "~8.5.0", "expo-auth-session": "~3.6.1", "expo-blur": "~11.1.0", "expo-clipboard": "~3.0.1", "expo-constants": "~13.1.1", "expo-dev-client": "~0.9.6", "expo-device": "~4.2.0", "expo-firebase-analytics": "~7.0.0", "expo-firebase-core": "~5.0.0", "expo-font": "~10.1.0", "expo-intent-launcher": "~10.2.0", "expo-linear-gradient": "~11.3.0", "expo-linking": "~3.1.0", "expo-localization": "~13.0.0", "expo-location": "~14.2.2", "expo-notifications": "~0.15.2", "expo-permissions": "~13.2.0", "expo-random": "~12.2.0", "expo-splash-screen": "~0.15.1", "expo-status-bar": "~1.3.0", "expo-system-ui": "~1.2.0", "expo-updates": "~0.13.1", "formik": "^1.5.7", "geolib": "^3.3.3", "i18next": "^19.5.0", "lodash": "^4.17.11", "lottie-react-native": "5.0.1", "memoizee": "^0.4.14", "moment": "^2.27.0", "numeral": "^2.0.6", "react": "17.0.2", "react-content-loader": "^6.0.3", "react-dom": "17.0.2", "react-i18next": "^11.7.0", "react-native": "0.68.2", "react-native-animatable": "^1.3.2", "react-native-big-list": "^1.4.3", "react-native-console-time-polyfill": "^1.2.1", "react-native-country-picker-modal": "^2.0.0", "react-native-easy-toast": "^1.2.0", "react-native-eva-icons": "^1.1.0", "react-native-fast-image": "^8.5.11", "react-native-formik": "^1.7.6", "react-native-gesture-handler": "~2.2.1", "react-native-image-zoom-viewer": "^3.0.1", "react-native-keyboard-aware-scroll-view": "^0.9.1", "react-native-maps": "0.30.2", "react-native-modal": "^13.0.0", "react-native-paper": "^2.16.0", "react-native-reanimated": "~2.8.0", "react-native-redash": "^16.2.2", "react-native-safe-area-context": "4.2.4", "react-native-screens": "~3.11.1", "react-native-svg": "12.3.0", "react-native-tab-view": "^2.16.0", "react-native-web": "0.17.7", "react-native-webview": "11.18.1", "react-navigation": "^4.4.4", "react-navigation-drawer": "^2.7.0", "react-navigation-stack": "^2.10.4", "react-navigation-tabs": "^2.11.0", "react-redux": "^7.1.0", "recompose": "^0.30.0", "redux": "^4.0.5", "redux-saga": "^1.0.5", "seamless-immutable": "^7.1.4", "sentry-expo": "^4.2.0", "socket.io-client": "^2.2.0", "uuid": "^3.4.0", "yup": "^0.27.0"
Environment
EAS CLI 0.52.0 environment info: System: OS: Windows 10 10.0.19044 Binaries: Node: 14.17.6 - C:\Program Files\nodejs\node.EXE npm: 6.14.15 - C:\Program Files\nodejs\npm.CMD Utilities: Git: 2.33.0. - /mingw64/bin/git npmPackages: expo: ^45.0.4 => 45.0.4 expo-dev-client: ~0.9.6 => 0.9.6 expo-updates: ~0.13.1 => 0.13.1 react: 17.0.2 => 17.0.2 react-dom: 17.0.2 => 17.0.2 react-native: 0.68.2 => 0.68.2 react-native-web: 0.17.7 => 0.17.7 react-navigation: ^4.4.4 => 4.4.4 Project workflow: managed
Reproducible demo
I can't reproduce it on a clean app with stripe-react-native and latest expo-dev-client.
I think the crash is caused by a combination of stripe react native 0.6.1 and one of the other dependencies.
So a reproducible example is to just create an expo dev client app with the dependencies above and run it on Android 10(device/emulator)
Stacktrace (if a crash is involved)
2022-05-21 12:20:53.105 30836-30836/com.my-app E/AndroidRuntime: FATAL EXCEPTION: main Process: com.my-app, PID: 30836 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my-app/expo.modules.devlauncher.launcher.errors.DevLauncherErrorActivity}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4060) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4247) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2613) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:219) at android.app.ActivityThread.main(ActivityThread.java:8668) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109) Caused by: java.lang.NullPointerException at expo.modules.devlauncher.launcher.errors.DevLauncherErrorActivity.onCreate(DevLauncherErrorActivity.kt:31) at android.app.Activity.performCreate(Activity.java:8214) at android.app.Activity.performCreate(Activity.java:8202) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1320) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4033) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4247) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2613) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:219) at android.app.ActivityThread.main(ActivityThread.java:8668) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)