Repository navigation
Description
Description
While testing the latest RC version, I've noticed the following error when starting the application:
Abort message: '/Users/alex/Documents/Projects/lottie-react-native/fabric-example/node_modules/react-native/ReactCommon/react/renderer/uimanager/bindingUtils.cpp:29: function getModule: assertion failed (moduleAsValue.isObject())'
@cortinico - I have provided a more simplified example project in my current WIP branch.
Version
0.70.1
Output of npx react-native info
System:
OS: macOS 12.5
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 125.38 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.2 - /usr/local/bin/node
Yarn: 1.22.18 - ~/.yarn/bin/yarn
npm: 5.1.0 - ~/Documents/Projects/lottie-react-native/node_modules/.bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.3 - /Users/alex/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
API Levels: 28, 29, 30, 31, 32, 33
Build Tools: 30.0.2, 30.0.3, 31.0.0
System Images: android-29 | Google Play Intel x86 Atom, android-31 | Google Play Intel x86 Atom_64, android-32 | Google APIs Intel x86 Atom_64, android-32 | Google Play Intel x86 Atom_64, android-33 | Google APIs Intel x86 Atom_64, android-33 | Google Play Intel x86 Atom_64
Android NDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8815526
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.16 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.0-rc.2 => 0.70.0-rc.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
- Clone https://github.com/AlexanderEggers/lottie-react-native/tree/feature/add-fabric-support
- yarn install
- cd lib
- yarn build
- cd ../examples/fabric
- yarn android
Snack, code example, screenshot, or link to a repository
https://github.com/AlexanderEggers/lottie-react-native/tree/feature/add-fabric-support
Activity
cortinico commentedon Aug 9, 2022
Thanks for reporting. For reference this a duplicate of #34056 #33618
As you provided a repro, we can investigate further 👍 I'll get back to you
cortinico commentedon Aug 9, 2022
I've done further testing and it seems like the
AppRegistryissue is actually related to a variety of different JS errors that make the JS runtime crash.You mentioned you had a branch working with New Architecture right? Could link it to me?
AlexanderEggers commentedon Aug 10, 2022
Yeah I had a local branch with that. I will try to provide you with something by early next week. I will let you know.
JesseLawler commentedon Aug 21, 2022
Any follow-up on this? I'm getting essentially the same issue (but with RN 0.69.4) and am wondering if there's a way forward or if I need to roll back to the old architecture.
Orange9000 commentedon Aug 23, 2022
In my case the reason for the
getModule: assertion failedcrash was this line:NativeModules.I18nManager.localeIdentifier, which I used to determine device language in one of my app's startup screens. By removing that I was at least able to go past certain startup operations like redux rehydration etc, but my app still crashes after that.So in general, I may assume the mentioned above type of errors has something to do with calling native functions from js.
I was able to determine the cause for the crash by using logs from Flipper's Device -> Logs section. Hope that helps someone.
AlexanderEggers commentedon Aug 24, 2022
I had a look into providing a RN69 example but I had to fully recreate that case because I removed the relevant branch already. Unfortunately that new branch is crashing now with the same error mentioned above. The underlying crash is definitely related to something this library integration is doing or generated based on the new arch specs. When removing the package from the example project, I can run the application without issues.
natioskar commentedon Sep 6, 2022
Hello, I'm getting the same kind of error after upgrading from 0.67.x, happens to me on 0.69, 0.70.rc3-4, and 0.70 stable that recently went out.
E0905 22:27:22.525616 54329344 bindingUtils.cpp:27] getModule of AppRegistry is not an object E0905 22:27:22.525718 54329344 bindingUtils.cpp:29] react_native_assert failure: moduleAsValue.isObject() Assertion failed: (moduleAsValue.isObject()), function getModule, file bindingUtils.cpp, line 29.I saw in a couple of other threads that the issue is not reproducing on a clean bootstrapped project, unfortunately in my case moving to a new skeleton project is not an option, many configurations and different environments are configured making it not a possible solution.
Anyone was able to pinpoint what exactly cause the issue? I've tried comparing all sorts of files in my project with the example project with no success so far
fawad-khalil commentedon Sep 20, 2022
@AlexanderEggers I am facing the same problem. RN version is 0.70.1 and I have installed iOS pods using new architecture and Fabric. Is there any update related to this issue?
12 remaining items
only1chi commentedon Oct 18, 2022
@douglowder I have the same problem and I tried commenting out the
react_native_assert()call, but nothing happened. I do know that the app is crashing because theAppRegistryseems to be returning an empty object.I wonder if anyone has any other suggestions or tips?
cortinico commentedon Oct 19, 2022
Yup @douglowder as @only1chi, removing the Assert is not sufficient. The failure is happening earlier in the execution time and we're not raising it early enough. The
AppRegistrybeing null is just a symptom of the underlying failure.only1chi commentedon Oct 19, 2022
@cortinico Any idea how I can expose the error since it's happening so early? At the moment, it feels more like guess work.
cortinico commentedon Oct 21, 2022
Yeah I know the pain. We don't have a solution for this specific instance at this stage, sadly. We're looking into it and hopefully come with a solution in the near future.
Any PR is also welcome in this space 🙏
antskelton commentedon Oct 27, 2022
The native crash is most likely triggered by a wrong import on the JS side of things.@cortinico's comment is as accurate as it is understated!
I've spent many hours bisecting this issue, and found it to be caused by any uncaught exception raised by code that runs before the call to
AppRegistry.registerComponent().In my case, I was importing my package.json (several levels deep in the import chain from index.js) and then dereferencing a non-existent property.
After fixing up a lot of similar issues, app runs fine. It's only unfortunate that the assertion makes them quite laborious to find.
only1chi commentedon Oct 30, 2022
@cortinico I did go through all the node-module packages and updated all the packages that were still using the deprecated
ViewPropTypes.However, I'm running into another issue with gesture handler best described here.
The gist of it is that when
react-native-gesture-handleris being built, it does not locate thereact-native-codegenlibrary, and it attempts to build from the script folder.Any thoughts on how to solve this?
cortinico commentedon Nov 7, 2022
Have you tried looking into the
codegenDirproperty of thereact{}block in the build.gradle file that lets you customize where codegen is located?j-piasecki commentedon Nov 9, 2022
@cortinico It may not be as simple as that, as applying the
com.facebook.reactplugin in the library'sbuild.gradleseems to be overriding the paths set in thereact{}block with the default ones.cortinico commentedon Nov 25, 2022
@j-piasecki could you elaborate on this? It's the first time we're hearing about this kind of behavior
j-piasecki commentedon Nov 28, 2022
@cortinico when you set the
codegenDirproperty in thereact{}block in the app'sbuild.gradleit doesn't propagate to the third-party libraries. What I believe is happening is when a library appliescom.facebook.reactplugin in itsbuild.gradlethe plugin is using the default values for all the properties, even if some are set in theappproject.Using something like
allows to work around this, but requires all modules be on the same level so the paths are correct.
github-actions commentedon Jun 1, 2023
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
cortinico commentedon Jun 1, 2023
@AlexanderEggers can we close this?
@j-piasecki issue has been fixed in #35495 also
AlexanderEggers commentedon Jun 1, 2023
Oh I missed reporting back around this issue. We got a working preview version with the new arch running for RN Lottie. I believe we can close this issue. Thanks @cortinico