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 - New Architecture crash on refresh #33665

Closed
yotamishak opened this issue Apr 19, 2022 · 5 comments
Closed

ANDROID - New Architecture crash on refresh #33665

yotamishak opened this issue Apr 19, 2022 · 5 comments
Labels
Impact: Crash Platform: Android Android applications. Priority: High Resolution: Answered When the issue is resolved with a simple answer Tech: React Native Core Issue related to the Core of React Native Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@yotamishak
Copy link

yotamishak commented Apr 19, 2022

Description

When running on the architecture, refresh does not work on android and causes crash

I have added the part of the logcat crash log from below(there are a lot of errors that happen as a result of the refresh)
Looks like the source of the error is from
/Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/../ReactCommon/react/renderer/mounting/ShadowTreeRegistry.cpp:17: function ~ShadowTreeRegistry: assertion failed (registry_.empty() && "Deallocation of non-empty `ShadowTreeRegistry`.")

  2022-04-11 12:08:19.296 11937-11937/com.projectname E/unknown:ReactInstanceManager: destroyRootView called
2022-04-11 12:08:19.296 11937-11937/com.projectname E/unknown:ReactInstanceManager: destroyRootView called, unmountReactApplication
2022-04-11 12:08:19.307 11937-11980/com.projectname D/EGL_emulation: app_time_stats: avg=598.08ms min=9.31ms max=10490.94ms count=18
2022-04-11 12:08:20.263 317-453/? I/netd: trafficSwapActiveStatsMap() <36.31ms>
2022-04-11 12:08:20.267 317-453/? I/netd: tetherGetStats() -> {[]} <2.05ms>
2022-04-11 12:08:20.270 317-453/? I/netd: bandwidthSetGlobalAlert(2097152) <0.23ms>
2022-04-11 12:08:20.277 317-453/? I/netd: bandwidthRemoveInterfaceQuota(eth0) <1.74ms>
2022-04-11 12:08:20.278 317-453/? I/netd: bandwidthSetInterfaceQuota(eth0, 9223372036854775807) <1.22ms>
2022-04-11 12:08:20.333 11937-12062/com.projectname W/unknown:ReactContext: initializeMessageQueueThreads() is called.
2022-04-11 12:08:20.334 11937-11991/com.projectname W/ReactNativeJNI: UIManagerBinding::~UIManagerBinding() was called (address: 0xb400007aec43dcf0).
2022-04-11 12:08:20.334 11937-11991/com.projectname W/ReactNativeJNI: UIManager::~UIManager() was called (address: 0xb400007b3c44fdf0).
2022-04-11 12:08:20.334 11937-11991/com.projectname E/ReactNative: /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/../ReactCommon/react/renderer/mounting/ShadowTreeRegistry.cpp:17: function ~ShadowTreeRegistry: assertion failed (registry_.empty() && "Deallocation of non-empty `ShadowTreeRegistry`.")
2022-04-11 12:08:20.334 11937-11991/com.projectname A/ReactNative: /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/../ReactCommon/react/renderer/mounting/ShadowTreeRegistry.cpp:17: function ~ShadowTreeRegistry: assertion failed (registry_.empty() && "Deallocation of non-empty `ShadowTreeRegistry`.")
2022-04-11 12:08:20.342 11937-11937/com.projectname W/unknown:ReactNative: Packager connection already open, nooping.
2022-04-11 12:08:20.487 11937-12064/com.projectname W/unknown:ReactContext: initializeMessageQueueThreads() is called.
2022-04-11 12:08:20.521 11937-11991/com.projectname A/com.projectnam: runtime.cc:669] Runtime aborting...
    runtime.cc:669] Dumping all threads without mutator lock held
    runtime.cc:669] All threads:
    runtime.cc:669] DALVIK THREADS (44):
    runtime.cc:669] "mqt_js" prio=5 tid=36 Runnable
    runtime.cc:669]   | group="" sCount=0 ucsCount=0 flags=0 obj=0x138c71d8 self=0xb400007bec468220
    runtime.cc:669]   | sysTid=11991 nice=0 cgrp=top-app sched=0/0 handle=0x79e0d57cb0
    runtime.cc:669]   | state=R schedstat=( 1300990692 34284672 865 ) utm=90 stm=39 core=1 HZ=100
    runtime.cc:669]   | stack=0x79e0c54000-0x79e0c56000 stackSize=1039KB
    runtime.cc:669]   | held mutexes= "abort lock" "mutator lock"(shared held)
    runtime.cc:669]   native: #00 pc 000000000040b390  /apex/com.android.art/lib64/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+116)
    runtime.cc:669]   native: #01 pc 0000000000713c08  /apex/com.android.art/lib64/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+240)
    runtime.cc:669]   native: #02 pc 000000000071b228  /apex/com.android.art/lib64/libart.so (art::DumpCheckpoint::Run(art::Thread*)+304)
    runtime.cc:669]   native: #03 pc 00000000002ca1b0  /apex/com.android.art/lib64/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+620)
    runtime.cc:669]   native: #04 pc 00000000006f99b0  /apex/com.android.art/lib64/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool)+476)
    runtime.cc:669]   native: #05 pc 00000000006eb5d4  /apex/com.android.art/lib64/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+204)
    runtime.cc:669]   native: #06 pc 00000000006eb37c  /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+1684)
    runtime.cc:669]   native: #07 pc 000000000001595c  /apex/com.android.art/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+76)
    runtime.cc:669]   native: #08 pc 0000000000006dc8  /system/lib64/liblog.so (__android_log_assert+308)
    runtime.cc:669]   native: #09 pc 0000000000000718  /data/app/~~TStRb-Ctyw5y1lsYyqFDfg==/com.projectname-Gi4nuYtjFN_EYajhATiLvA==/lib/arm64/libreact_debug.so (react_native_assert_fail+104)
    runtime.cc:669]   native: #10 pc 00000000000bbebc  /data/app/~~TStRb-Ctyw5y1lsYyqFDfg==/com.projectname-Gi4nuYtjFN_EYajhATiLvA==/lib/arm64/libreact_render_mounting.so (facebook::react::ShadowTreeRegistry::~ShadowTreeRegistry()+72)
    runtime.cc:669]   native: #11 pc 00000000000684a0  /data/app/~~TStRb-Ctyw5y1lsYyqFDfg==/com.projectname-Gi4nuYtjFN_EYajhATiLvA==/lib/arm64/libreact_render_uimanager.so (facebook::react::UIManager::~UIManager()+240)
    runtime.cc:669]   native: #12 pc 000000000006c328  /data/app/~~TStRb-Ctyw5y1lsYyqFDfg==/com.projectname-Gi4nuYtjFN_EYajhATiLvA==/lib/arm64/libreact_render_scheduler.so (std::__ndk1::__shared_ptr_emplace<facebook::react::UIManager, std::__ndk1::allocator<facebook::react::UIManager> >::__on_zero_shared()+28)
    runtime.cc:669]   native: #13 pc 000000000005e448  /data/app/~~TStRb-Ctyw5y1lsYyqFDfg==/com.projectname-Gi4nuYtjFN_EYajhATiLvA==/lib/arm64/libreact_render_scheduler.so (???)
    runtime.cc:669]   native: #14 pc 000000000005e3ec  /data/app/~~TStRb-Ctyw5y1lsYyqFDfg==/com.projectname-Gi4nuYtjFN_EYajhATiLvA==/lib/arm64/libreact_render_scheduler.so (???)
    runtime.cc:669]   native: #15 pc 0000000000062028  /data/app/~~TStRb-Ctyw5y1lsYyqFDfg==/com.projectname-Gi4nuYtjFN_EYajhATiLvA==/lib/arm64/libreact_render_scheduler.so (std::__ndk1::shared_ptr<facebook::react::UIManager>::~shared_ptr()+44)
    runtime.cc:669]   native: #16 pc 000000000008bae8  /data/app/~~TStRb-Ctyw5y1lsYyqFDfg==/com.projectname-Gi4nuYtjFN_EYajhATiLvA==/lib/arm64/libreact_render_uimanager.so (facebook::react::UIManagerBinding::~UIManagerBinding()+204)
2022-04-11 12:08:20.521 11937-11991/com.projectname A/com.projectnam: runtime.cc:669]   native: #17 pc 000000000008f04c  /data/app/~~TStRb-Ctyw5y1lsYyqFDfg==/com.projectname-Gi4nuYtjFN_EYajhATiLvA==/lib/arm64/libreact_render_uimanager.so (std::__ndk1::__shared_ptr_emplace<facebook::react::UIManagerBinding, std::__ndk1::allocator<facebook::react::UIManagerBinding> >::__on_zero_shared()+36)

....there's more where that came from

Also, when building I saw the following warnings

> Task :app:mergeDebugNativeLibs
2 files found for path 'lib/arm64-v8a/libc++_shared.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libc++_shared.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libc++_shared.so

2 files found for path 'lib/arm64-v8a/libfabricjni.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libfabricjni.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libfabricjni.so

2 files found for path 'lib/arm64-v8a/libfbjni.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libfbjni.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libfbjni.so

2 files found for path 'lib/arm64-v8a/libfolly_futures.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libfolly_futures.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libfolly_futures.so

2 files found for path 'lib/arm64-v8a/libfolly_json.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libfolly_json.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libfolly_json.so

2 files found for path 'lib/arm64-v8a/libglog.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libglog.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libglog.so

2 files found for path 'lib/arm64-v8a/libjsi.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libjsi.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libjsi.so

2 files found for path 'lib/arm64-v8a/libreact_codegen_rncore.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libreact_codegen_rncore.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libreact_codegen_rncore.so

2 files found for path 'lib/arm64-v8a/libreact_debug.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libreact_debug.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libreact_debug.so

2 files found for path 'lib/arm64-v8a/libreact_nativemodule_core.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libreact_nativemodule_core.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libreact_nativemodule_core.so

2 files found for path 'lib/arm64-v8a/libreact_render_componentregistry.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libreact_render_componentregistry.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libreact_render_componentregistry.so

2 files found for path 'lib/arm64-v8a/libreact_render_core.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libreact_render_core.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libreact_render_core.so

2 files found for path 'lib/arm64-v8a/libreact_render_debug.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libreact_render_debug.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libreact_render_debug.so

2 files found for path 'lib/arm64-v8a/libreact_render_graphics.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libreact_render_graphics.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libreact_render_graphics.so

2 files found for path 'lib/arm64-v8a/librrc_view.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/librrc_view.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/librrc_view.so

2 files found for path 'lib/arm64-v8a/libruntimeexecutor.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libruntimeexecutor.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libruntimeexecutor.so

2 files found for path 'lib/arm64-v8a/libturbomodulejsijni.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libturbomodulejsijni.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libturbomodulejsijni.so

2 files found for path 'lib/arm64-v8a/libyoga.so'. This version of the Android Gradle Plugin chooses the file from the app or dynamic-feature module, but this can cause unexpected behavior or errors at runtime. Future versions of the Android Gradle Plugin may throw an error in this case.
Inputs:
 - /Users/yotamishak/aaa/temp/projectName/android/app/build/intermediates/cxx/Debug/3z41443p/obj/local/arm64-v8a/libyoga.so
 - /Users/yotamishak/aaa/temp/projectName/node_modules/react-native/ReactAndroid/build/intermediates/library_jni/debug/jni/arm64-v8a/libyoga.so

Version

0.68.1

Output of npx react-native info

System:
OS: macOS 12.1
CPU: (8) arm64 Apple M1
Memory: 117.97 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.18.2 - ~/.nvm/versions/node/v14.18.2/bin/node
Yarn: 1.22.11 - ~/node_modules/.bin/yarn
npm: 8.3.0 - ~/.nvm/versions/node/v14.18.2/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
API Levels: 28, 29, 30, 31
Build Tools: 26.0.2, 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0
System Images: android-30 | Google Play ARM 64 v8a, android-31 | Google APIs ARM 64 v8a, android-Tiramisu | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8309675
Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
Languages:
Java: 11.0.14.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.68.1 => 0.68.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. react-native init projectName
  2. enable new architecture (android/gradle.properties => newArchEnabled=true)
  3. press 'r' inside metro or double click 'r'

Snack, code example, screenshot, or link to a repository

No response

@cortinico
Copy link
Contributor

Could you provide a reproducer of any form @yotamishak?

@rvasseur31
Copy link

Here it is : https://github.com/rvasseur31/TestRefreshNewArchitecture

@CD3108
Copy link

CD3108 commented Jun 7, 2022

Has anyone solved it ?

@rvasseur31
Copy link

Yes, you should update to react native 69

@cortinico
Copy link
Contributor

Yes, you should update to react native 69

Closing as this is considered resolved 👍

@cortinico cortinico added Resolution: Answered When the issue is resolved with a simple answer and removed Needs: Author Feedback labels Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impact: Crash Platform: Android Android applications. Priority: High Resolution: Answered When the issue is resolved with a simple answer Tech: React Native Core Issue related to the Core of React Native Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

6 participants