question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ANDROID - New Architecture crash on refresh

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
rvasseur31commented, May 19, 2022
0reactions
cortinicocommented, Jul 29, 2022

Yes, you should update to react native 69

Closing as this is considered resolved 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crashes - Android Developers
An app that is written using Java or Kotlin crashes if it throws an unhandled exception, represented by the Throwable class.
Read more >
App Crashing on refresh - android - Stack Overflow
1 Answer 1 ... The exception that is thrown when there is not enough memory to continue the execution of a program. ......
Read more >
Crashing Android apps will now tell you to install an update to ...
Based on the strings, it will likely be possible to update the app in question right away from the prompt, though it's good...
Read more >
After the next update, StandardNotes is crashing on android
There's a crash-on-launch issue on the version of the app currently on F-Droid (3.14.0). A fix has already been released as part of...
Read more >
Troubleshooting - React Native
You will also need to update your applications to load the JavaScript bundle from the new port. If running on device from Xcode, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found