Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Cannot read property 'addListener' of undefined #131

Closed
ermamud opened this issue Oct 26, 2023 · 3 comments
Closed

[Android] Cannot read property 'addListener' of undefined #131

ermamud opened this issue Oct 26, 2023 · 3 comments
Assignees
Labels
bug Something isn't working invalid This issue doesn't seem right

Comments

@ermamud
Copy link

ermamud commented Oct 26, 2023

Hi,
I am React Native with Expo (v0.72.5) and after installing this package using the expo command, I am getting an error only on Android.
I created the same IntroModal you have in the examples and this is the error:

TypeError: Cannot read property 'addListener' of undefined
TypeError: Cannot read property 'addListener' of undefined
    at MegaAlert (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:146229:33)
    at renderWithHooks (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:90173:33)
    at mountIndeterminateComponent (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:93255:34)
    at beginWork (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:94501:49)
    at beginWork$1 (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:98850:29)
    at performUnitOfWork (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:98192:29)
    at workLoopSync (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:98127:28)
    at renderRootSync (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:98104:25)
    at performSyncWorkOnRoot (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:97829:40)
    at flushSyncCallbacks (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:87021:36)
    at flushSyncCallbacksOnlyInLegacyMode (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:87003:29)
    at scheduleUpdateOnFiber (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:97390:47)
    at dispatchSetState (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:91150:34)
    at ?anon_0_ (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:130308:26)
    at next (native)
    at asyncGeneratorStep (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:6080:26)
    at _next (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:6099:29)
    at tryCallOne (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/Release/554c6x4t/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:53:16)
    at anonymous (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/Release/554c6x4t/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:139:27)
    at apply (native)
    at anonymous (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:39583:26)
    at _callTimer (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:39462:17)
    at _callReactNativeMicrotasksPass (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:39507:17)
    at callReactNativeMicrotasks (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:39713:44)
    at __callReactNativeMicrotasks (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:3691:46)
    at anonymous (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:3465:45)
    at __guard (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:3664:15)
    at flushedQueue (http://10.0.2.2:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&minify=false&app=com.account.app&modulesOnly=false&runModule=true:3464:21)

any idea how can I get this issue fixed?

Thank you,
Ernesto

@CharlesMangwa CharlesMangwa self-assigned this Oct 26, 2023
@CharlesMangwa CharlesMangwa added bug Something isn't working repro needed Reproducible demo app/Expo Snack is needed labels Oct 26, 2023
@CharlesMangwa
Copy link
Member

hi @ermamud! could you add a repro on snack please? this would help a lot, thx!

@ermamud
Copy link
Author

ermamud commented Oct 27, 2023

I am not able to reproduce the same exact issue using a snack, after further testing, I am getting the previous error on both iOS and Android but only after I did a native build, previously it was just working fine.

I created this snack and you can see that is not working, not sure if it's the same error because I don't see any error, the web version works fine but the ios/android is freezing after trying to open the modal:

https://snack.expo.dev/@ermamud/modalfy_error_test

thanks

@CharlesMangwa CharlesMangwa added invalid This issue doesn't seem right and removed repro needed Reproducible demo app/Expo Snack is needed labels Mar 8, 2024
@CharlesMangwa
Copy link
Member

hey @ermamud, sorry for the long delay. i hope you managed to sort this out, but just in case, here's your snack fixed. you can focus on ./components/introModal.tsx: https://snack.expo.dev/trVMWWgcMpHkd6jpBYZKW.

tldr;: the way you were updating animatedValue + the use of View instead of Animated.View is what was causing the "crash".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This issue doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants