Closed adblanc closed 3 years ago
@adblanc I am glad you were able to reproduce it. The other day I tried myself using the template and I wasn't able to reproduce it
I here with the same problem, randomly some of my android users experience unexpected closings at the time of opening the application (cold start),
a while ago I created an issue in the reanimated repository:
https://github.com/software-mansion/react-native-reanimated/issues/1454
as well as some comments on the following expo issues:
https://github.com/expo/expo/issues/10564 https://github.com/expo/expo/issues/11266 https://github.com/expo/expo/issues/11529
Today one of the users of my application shared the error log and video of the crash:
https://user-images.githubusercontent.com/140472/105931514-1c9ee380-602a-11eb-931c-bc68d57da52f.MOV
The phone is a moto g (8) power lite, but it happens with some other devices too, here I attach a screenshot from the google play console:
I was looking at some issues of reanimated there are several incidents that point to the same thing but I do not know if they are related in any way or could it be something of the configuration of the "android" workers of Expo?
Here I also attach the files of the configuration of my application,
package.json:
{
"name": "ambito-dolar",
"main": "node_modules/expo/AppEntry.js",
"private": true,
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"release": "release-it --no-npm.publish"
},
"dependencies": {
"@expo/react-native-action-sheet": "^3.4.1",
"@rainbow-me/animated-charts": "^1.0.0-alpha.3",
"@react-native-community/hooks": "^2.5.1",
"@react-native-community/masked-view": "0.1.10",
"@react-navigation/bottom-tabs": "^5.4.5",
"@react-navigation/native": "^5.2.0",
"@react-navigation/stack": "^5.2.9",
"@use-expo/font": "^2.0.0",
"@zeit/fetch-retry": "^5.0.0",
"d3-array": "^2.4.0",
"deep-diff": "^1.0.2",
"expo": "^40.0.0",
"expo-analytics-amplitude": "~9.0.0",
"expo-app-loading": "^1.0.1",
"expo-constants": "~9.3.3",
"expo-device": "~2.4.0",
"expo-file-system": "~9.3.0",
"expo-image-manipulator": "~8.4.0",
"expo-linking": "~2.0.0",
"expo-localization": "~9.1.0",
"expo-mail-composer": "~9.0.0",
"expo-notifications": "~0.8.2",
"expo-sharing": "~8.5.0",
"expo-status-bar": "~1.0.3",
"expo-store-review": "~2.3.0",
"firebase": "7.9.0",
"i18n-js": "^3.5.1",
"immutability-helper": "^3.0.0",
"lodash": "^4.17.15",
"moment": "^2.29.0",
"numeral": "^2.0.6",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
"react-native-appearance": "~0.3.3",
"react-native-collapsible": "^1.5.1",
"react-native-gesture-handler": "~1.8.0",
"react-native-iphone-x-helper": "^1.2.1",
"react-native-reanimated": "2.0.0-rc.0",
"react-native-safe-area-context": "3.1.9",
"react-native-screens": "~2.15.0",
"react-native-segmented-control-tab": "^3.4.1",
"react-native-svg": "12.1.0",
"react-native-typography": "^1.4.0",
"react-native-view-shot": "3.1.2",
"react-native-web": "~0.13.12",
"react-navigation-header-buttons": "^6.0.0",
"react-redux": "^7.1.1",
"redux": "^4.0.1",
"redux-persist": "^6.0.0",
"redux-persist-expo-filesystem": "^2.0.0",
"redux-persist-transform-filter": "^0.0.20",
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
"semver": "^7.1.1",
"sentry-expo": "~3.0.2",
"swr": "^0.4.0",
"victory": "^35.0.8",
"victory-native": "^35.0.1"
},
"devDependencies": {
"@expo/webpack-config": "~0.12.45",
"@typescript-eslint/eslint-plugin": "^4.12.0",
"@typescript-eslint/parser": "^4.12.0",
"babel-plugin-inline-dotenv": "^1.6.0",
"babel-plugin-module-resolver": "^4.0.0",
"babel-preset-expo": "8.3.0",
"dotenv": "^8.2.0",
"eslint": "^7.17.0",
"eslint-config-universe": "^7.0.0",
"prettier": "^2.2.1",
"redux-devtools-extension": "^2.13.8",
"release-it": "^14.0.3",
"typescript": "^4.1.3"
},
"resolutions": {
"react-native-gesture-handler": "~1.8.0",
"react-native-reanimated": "2.0.0-rc.0"
},
"version": "3.1.4"
}
app.config.js:
import 'dotenv/config';
const version = '3.1.4';
const buildNumber = 49;
export default {
name: 'Ámbito Dólar',
slug: 'ambito-dolar',
privacy: 'hidden',
platforms: ['android', 'ios', 'web'],
version,
orientation: 'portrait',
icon: './assets/icon.png',
splash: {
image: './assets/splash-dark-content.png',
resizeMode: 'contain',
backgroundColor: '#FFFFFF',
},
userInterfaceStyle: 'automatic',
ios: {
bundleIdentifier: 'im.outa.AmbitoDolar',
buildNumber: buildNumber.toString(),
infoPlist: {
CFBundleDevelopmentRegion: 'es',
UISupportedInterfaceOrientations: ['UIInterfaceOrientationPortrait'],
'UISupportedInterfaceOrientations~ipad': [
'UIInterfaceOrientationLandscapeLeft',
'UIInterfaceOrientationLandscapeRight',
],
UIRequiresFullScreen: true,
LSApplicationQueriesSchemes: ['twitter', 'tg', 'instagram', 'fb'],
},
supportsTablet: true,
config: {
usesNonExemptEncryption: false,
},
},
android: {
package: 'im.outa.AmbitoDolar',
versionCode: buildNumber,
googleServicesFile: './google-services.json',
icon: './assets/icon.android.png',
adaptiveIcon: {
foregroundImage: './assets/icon.android.adaptive.foreground.png',
backgroundImage: './assets/icon.android.adaptive.background.png',
},
permissions: [],
allowBackup: false,
softwareKeyboardLayoutMode: 'pan',
useNextNotificationsApi: true,
},
notification: {
icon: './assets/icon.notification.png',
color: '#2ECC71',
},
hooks: {
postPublish: [
{
file: 'sentry-expo/upload-sourcemaps',
config: JSON.parse(process.env.SENTRY_HOOK_CONFIG_JSON),
},
],
},
updates: {
fallbackToCacheTimeout: 0,
},
assetBundlePatterns: ['**/*'],
};
I hope all this is useful 🙏
btw, it seems that if the affected Android users clear the cache and delete the application data the problem would be solved, which again makes me think that it may be something from Expo 🤔
Hi everyone,
I would like to report the same issue for a managed app using EXPO 40 and Reanimated2.
Deleting the cache and application data DOES NOT solve the problem. The app crashes randomly on start and only on some devices. When it crashes, it crashes on start. I used adb logcat
to see what was going on and the same error as mentioned above is reported
02-03 16:11:16.806 27507 27588 W ReactNativeJS: Unable to start your application. Please refer to https://expo.fyi/no-registered-application for more information.
02-03 16:11:16.812 27507 27588 E ReactNativeJS: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary.
02-03 16:11:16.821 27507 27589 E unknown:ReactNative: com.facebook.react.common.JavascriptException: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary., stack:
I am also getting this error
[Wed Feb 10 2021 09:15:51.966] INFO Initializing react-native-branch v. 5.0.1 [Wed Feb 10 2021 09:15:51.967] ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes [Wed Feb 10 2021 09:15:51.969] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication), js engine: hermes
System: OS: macOS 10.15.4 CPU: (4) x64 Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz Memory: 18.94 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 9.11.2 - ~/.nvm/versions/node/v9.11.2/bin/node Yarn: 1.22.0 - /usr/local/bin/yarn npm: 6.14.6 - ~/.nvm/versions/node/v9.11.2/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.1 - /Users/omprakash/.rvm/gems/ruby-2.5.1/bin/pod SDKs: iOS SDK: Platforms: iOS 14.3, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2 Android SDK: API Levels: 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 Build Tools: 23.0.1, 23.0.2, 23.0.3, 25.0.0, 25.0.2, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3, 29.0.0, 29.0.2, 29.0.3 System Images: android-23 | Google APIs Intel x86 Atom, android-24 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.0 AI-193.6911.18.40.6514223 Xcode: 12.3/12C33 - /usr/bin/xcodebuild Languages: Java: 1.8.0_242 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: ^4.1.0 => 4.14.0 react: 16.13.1 => 16.13.1 react-native: 0.63.4 => 0.63.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
It might be related to Hermes. I just ejected and got same error but was able to fix it by following instruction on the reanimated documentation site. First step of that instruction is to enable Hermes. As far as I know managed workflow doesn't support Hermes at the moment.
Hey @EvanBacon @brentvatne
Do you know if the crash on Android will be fixed with the official release of reanimated v2
Using Reanimated 2 with Expo
We wouldn’t be able to get as many people to try Reanimated 2 if not the support from the Expo team (special thanks to Tomasz Sapeta, Stanisław, Brent and Evan). We are very grateful for the opportunity of incorporating beta version of Reanimated 2 into Expo as early as in SDK 39 which went out in August 2020. We are happy to announce that the stable release of Reanimated will be a part of the next Expo SDK release (41) which will go out in the upcoming weeks.
i cloned the repo that @adblanc provided, ran it in Expo Go and it worked as expected, then i ran expo build:android -t apk
and installed it the resulting apk in an emulator (pixel 3 api 29) and it also worked. i installed it on my oneplus 6t api 29 and it also worked.
please download the apk and run it on your device: https://exp-shell-app-assets.s3.us-west-1.amazonaws.com/android/%40notbrent/r2-test-e22670de13fe4a8aa1ac271f62c21d76-signed.apk
if you can reproduce it in an emulator, please let me know the avd configuration.
for people seeing the turbomodules related crash, please remember that you should not use the "turboModules": true
flag in app.json! turbomodules are not used on the latest version of reanimated and enabling turbomodules is likely to cause problems in your app.
we have a pr open already to update to reanimated v2 stable (https://github.com/expo/expo/pull/12039) but i'd love to be able to get more info on what is going on here so i can reproduce and see if the issue is fixed.
@brentvatne I just tried the install on my phone (Pixel 4). The app opens the first time. I toggled the button a few time. All good. Then I closed the app, started the app again a couple times and the crashed happened again. The app opens and closes right away. Looks exactly like the issue I had a few weeks ago.
Anything else I can do to help?
you're right, closing and reopening it reproduces this issue, thank you @msevestre!
@brentvatne awesome. When you have a fix, I'll be happy to try it out again to verify. Good luck 🤞
Just CCing @Szymon20000 here as he may have some time to look into this issue after 3/15
@brentvatne @Szymon20000 Any news on that by any chance?
i have tested this on sdk 41 (which is close to entering beta) and been unable to reproduce this issue. you can try this apk on your device to verify: https://github.com/brentvatne/files/raw/master/apks/reanimated2sdk41.apk.zip
I have a similar issue with expo SDK 40 with Reanimated2. I followed the steps as described here and in expo docs to add and have the following error.
Error: If you want to use Reanimated 2 then go through our installation steps https://docs.swmansion.com/react-native-reanimated/docs/installation
@claraberendsen - you're missing the babel plugin, see https://docs.expo.io/versions/v40.0.0/sdk/reanimated/#installation
i have tested this on sdk 41 (which is close to entering beta) and been unable to reproduce this issue. you can try this apk on your device to verify: https://github.com/brentvatne/files/raw/master/apks/reanimated2sdk41.apk.zip
Couldn't reproduce it either with your apk, excited to upgrade to SDK 41 :smile:
The issue still exists. I just created an .aab file and set up an internal test on Google Play Store.
Expo SDK 41.0.0 Android 10 Pixel 3a
Error If you want to use Reanimated 2 then go through our installation steps https://docs.swmansion.com/react-native-reanimated/docs/installation
Crashes at const scale = useSharedValue(1)
in production. Not in Dev.
"expo": "^41.0.0-beta.3", "react-native-reanimated": "~2.1.0",
babel.config.js: module.exports = function (api) { api.cache(true) return { presets: ['babel-preset-expo'], plugins: ['react-native-reanimated/plugin'] } }
Unfortunately experiencing the same issue as @brandtnewww with SDK BETA 41, it appears to be a different error than the one we're having with SDK 40 so maybe I should create another issue and try to create a reproducible example
@adblanc Not sure if it's different. I used SDK 40 before and had the issue coming up in Sentry too. I then updated to the latest SDK BETA 41 in hope of a fix but it didn't help. Same issue in Sentry.
I had this problem in sdk39 and 40. as per advice in my last issue #11266 I have waited till official support of reanimatedv2 and it is now available with sdk41. But the issue is same.
App works fine in expo go app even in production mode with minify which should be equivalent to standalone apk. Only standalone apk is failing.
I have created a new project after the news of official support of reanimatedv2 and when I ran first build it still had the same problem. Project link: https://github.com/phoenixcreation/relaxer
If you think I am doing something wrong please clone the repo and create a standalone build of it. Then test it and let me know if it works or not.
If anyone finds the solution of this please let us know. Thanks in advance.
My solution was to create a new App without Expo 🙄
Let me know if I can help you somehow solving this issue though. Would be great to be able to use Expo in the near future to build production-ready Apps, as I love the seamless workflow your team created here 😊
My solution was to create a new App without Expo 🙄
@brandtnewww What are the steps for managed workflow? If possible without android studio (I know it sounds strange but if possible). With android studio will be appreciated too.
@brandtnewww - can you provide a minimal repro that i can clone and run? i just took the example from the OP, updated it to sdk 41, did expo build:android -t apk
, installed it to emulator and opened, reopened it about 10 times and it worked as expected.
https://github.com/brentvatne/reanimated2-crash-repo apk: https://exp-shell-app-assets.s3.us-west-1.amazonaws.com/android/%40notbrent/r2-test-3a1fc75e3de14af2b394f413818105db-signed.apk
https://user-images.githubusercontent.com/90494/115441394-a7285680-a1c5-11eb-9c8a-125c38ba9904.mov
another option is to eas build to create your standalone app builds. we'll be talking about this soon but it's possible to do this in sdk 41. in this case, the result would be exactly the same as if you included reanimated 2 in any react-native project (minus hermes).
here's an apk for the same app but built with eas build: https://turtle-v2-artifacts.s3.amazonaws.com/android/477db6d8-aa1f-4490-b18b-e7baebd2a026-519b558631a54fe78a24095da0d04e75.apk -- if you have trouble with the first apk, let me know if you observe the same issues on this one
@brentvatne using the same phone as mentioned firstly, experiencing crashes with the non-eas build but eas build works flawlessly :smile:
@adblanc - that's great to know. does it crash often on that phone? thanks for verifying!
@brentvatne no problem, it depends but right now it crashed 7 times out of 10 attempts
The issue still exists. I just created an .aab file and set up an internal test on Google Play Store.
Expo SDK 41.0.0 Android 10 Pixel 3a
Error If you want to use Reanimated 2 then go through our installation steps https://docs.swmansion.com/react-native-reanimated/docs/installation
Crashes at
const scale = useSharedValue(1)
in production. Not in Dev."expo": "^41.0.0-beta.3", "react-native-reanimated": "~2.1.0",
babel.config.js: module.exports = function (api) { api.cache(true) return { presets: ['babel-preset-expo'], plugins: ['react-native-reanimated/plugin'] } }
Having the same issue, crashed on android expo go and standalone
"expo": "^41.0.0", "react-native-reanimated": "~2.1.0",
@brentvatne what is problems in this repo? https://github.com/phoenixcreation/crash-check-expo
This is total changes done on blank template. https://github.com/PhoenixCreation/crash-check-expo/commit/52c2de2213064f7b6e56ab7189ce62259d14bef7
I ran expo build:android -t apk
and created apk.
this is apk link: https://exp-shell-app-assets.s3.us-west-1.amazonaws.com/android/%40phoenixcreation/crash-check-81c8c976186445a8acbd144c1fe98c7c-signed.apk
It is crashing on start on physical device. Can you check this please. Thanks in advance.
@PhoenixCreation - that looks fine but it's the first time i am seeing a link to that repo 😅 you previously shared a link to a repo with a ton of unrelated code. we're investigating this issue now.
we will be deploying the fix from #12650 this afternoon
@brentvatne That's such good news, we simply have to create a new build after this afternoon for this change to take place? or are you going to let us know again?
i'll let you know when it's live
will leave issue open until fix is deployed
@outaTiME @adblanc - can you try this apk? https://exp-shell-app-assets.s3.us-west-1.amazonaws.com/android/%40notbrent/r2-test-dd964ba6d3bd400792e7426e943b9a83-signed.apk
@brentvatne i have same issue like TS on my galaxy S7, but your app working
@brentvatne this apk works perfectly, opened it ~20 times and didn't see any crash :smiley:
@adblanc - great! this is in production now. give it a try with expo build
Awesome @brentvatne I tested your APK on various android devices and I haven't seen any crash either, thanks for everything including @lukmccall 🙌
The issue still exists. I just created an .aab file and set up an internal test on Google Play Store.
Expo SDK 41.0.0 Android 10 Pixel 3a
Error If you want to use Reanimated 2 then go through our installation steps https://docs.swmansion.com/react-native-reanimated/docs/installation
Crashes at
const scale = useSharedValue(1)
in production. Not in Dev."expo": "^41.0.0-beta.3", "react-native-reanimated": "~2.1.0",
babel.config.js: module.exports = function (api) { api.cache(true) return { presets: ['babel-preset-expo'], plugins: ['react-native-reanimated/plugin'] } }
Sometimes and very sporadically, some devices with android throw me this fault and report it by sentry. @brentvatne can it be that after an OTA update, reanimated does not initialize correctly?
I am using SDK41 and reanimated "~ 2.1.0" on managed workflow
Here is the code on the line where the error was thrown:
ota update shouldn't impact it, unless the ota update was missing the reanimated 2 plugin. maybe worth reporting this to the reanimated 2 repository as at this point i believe we are initializing everything correctly.
yup, it's something weird that happened only twice on android devices, the striking thing is that just yesterday I did an ota update (that's why I mentioned it).
I will be verifying, if it happens again I will create an incident in the reanimated repo, but it is good that you are also aware of this just in case
🐛 Bug Report
Summary of Issue
Standalone build crashes when opening it on my android physical device (galaxy S8 used). Related to https://github.com/expo/expo/issues/10564 and https://github.com/expo/expo/issues/11529
Environment - output of
expo diagnostics
& the platform(s) you're targetingExpo CLI 4.0.17 environment info: System: OS: Linux 5.4 Ubuntu 18.04.4 LTS (Bionic Beaver) Shell: 5.4.2 - /usr/bin/zsh Binaries: Node: 12.15.0 - /usr/bin/node Yarn: 1.22.5 - /usr/bin/yarn npm: 6.13.4 - /usr/bin/npm SDKs: Android SDK: API Levels: 28, 29 Build Tools: 28.0.3, 29.0.2 System Images: android-28 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom npmPackages: expo: ~40.0.0 => 40.0.0 react: 16.13.1 => 16.13.1 react-dom: 16.13.1 => 16.13.1 react-native: https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz => 0.63.2 react-native-web: ~0.13.12 => 0.13.18 npmGlobalPackages: expo-cli: 4.0.17 Expo Workflow: managed
I'm targeting both IOS and android but I can't test it on IOS.
Reproducible Demo
https://github.com/adblanc/reanimated2-crash-repo
Steps to Reproduce
Expected Behavior vs Actual Behavior
I expect my app to start and function correctly, as it does when using expo client. Instead, by debugging it using adb logcat, I get the following error on start :
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found
`01-19 10:20:18.850 9249 9322 E ReactNativeJNI: logMarker RUN_JS_BUNDLE_END 01-19 10:20:18.853 9249 9322 I ReactNativeJS: Running "main" with {"initialProps":{"exp":{"initialUri":"https://expo.io:443/@adrienblc/r2-test","lastErrors":[{"errorMessage":"Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary., stack:\nexports@21:286\ngetEnforcing@27:169\n