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

App crashing on Android with Repack v5 & Module Federation V2 in release mode #891

Open
duynguyen250399 opened this issue Jan 22, 2025 · 10 comments
Labels
status:confirmed The issue has been reviewed and all necessary information is provided. type:bug A bug report.

Comments

@duynguyen250399
Copy link

Describe the bug

Hi Team,

I am building a super app using Repack v5 and Module Federation v2. The host app works normally when I run it in debug mode, but it crashes when I try to run it in release mode and I don't know why. I expect it should not crash.

Debug Release
Image Image

Logcat:

terminating due to uncaught exception of type facebook::jni::JniException: com.facebook.react.common.JavascriptException: EarlyJsError: Property 'console' doesn't exist, stack:
                                                                                                    supportColor@1:184874
                                                                                                    formatter@1:185145
                                                                                                    38711@1:182750
                                                                                                    __webpack_require__@1:6728
                                                                                                    guardedWebpackRequire@1:885579
                                                                                                    33913@1:149617
                                                                                                    __webpack_require__@1:6728
                                                                                                    guardedWebpackRequire@1:885579
                                                                                                    76978@1:102091
                                                                                                    __webpack_require__@1:6728
                                                                                                    guardedWebpackRequire@1:885579
                                                                                                    73373@1:161615
                                                                                                    __webpack_require__@1:6728
                                                                                                    guardedWebpackRequire@1:885579
                                                                                                    77337@1:220449
                                                                                                    __webpack_require__@1:6728
                                                                                                    guardedWebpackRequire@1:885579
                                                                                                    anonymous@1:6593
                                                                                                    global@1:80
2025-01-22 18:05:59.808   314-314   RanchuHwc               [email protected]  I  validateDisplay: layer 1004 CompositionType 1, fallback to client
2025-01-22 18:05:59.812 12861-12883 libc                    pid-12861                            A  Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 12883 (mqt_v_js), pid 12861 (com.host.app)
2025-01-22 18:05:59.826   314-314   RanchuHwc               [email protected]  I  validateDisplay: layer 1004 CompositionType 1, fallback to client
2025-01-22 18:05:59.842   314-314   RanchuHwc               [email protected]  I  validateDisplay: layer 1004 CompositionType 1, fallback to client
2025-01-22 18:05:59.859   314-314   RanchuHwc               [email protected]  I  validateDisplay: layer 1004 CompositionType 1, fallback to client
2025-01-22 18:05:59.868   149-149   hwservicemanager        hwservicemanager                     I  getTransport: Cannot find entry [email protected]::IMapper/default in either framework or device VINTF manifest.
2025-01-22 18:05:59.869 12861-12877 Gralloc4                pid-12861                            I  mapper 4.x is not supported
2025-01-22 18:05:59.874   149-149   hwservicemanager        hwservicemanager                     I  getTransport: Cannot find entry [email protected]::IAllocator/default in either framework or device VINTF manifest.
2025-01-22 18:05:59.874   314-314   RanchuHwc               [email protected]  I  validateDisplay: layer 1004 CompositionType 1, fallback to client
2025-01-22 18:05:59.880   147-147   servicemanager          servicemanager                       I  Could not find android.hardware.graphics.allocator.IAllocator/default in the VINTF manifest.
2025-01-22 18:05:59.880 12861-12877 Gralloc4                pid-12861                            W  allocator 4.x is not supported
2025-01-22 18:05:59.891   314-314   RanchuHwc               [email protected]  I  validateDisplay: layer 1004 CompositionType 1, fallback to client
2025-01-22 18:05:59.901 12890-12890 crash_dump64            pid-12890                            I  obtaining output fd from tombstoned, type: kDebuggerdTombstoneProto
2025-01-22 18:05:59.902   196-196   tombstoned              tombstoned                           I  received crash request for pid 12883
2025-01-22 18:05:59.904 12890-12890 crash_dump64            pid-12890                            I  performing dump of process 12861 (target tid = 12883)
2025-01-22 18:05:59.908   314-314   RanchuHwc               [email protected]  I  validateDisplay: layer 1004 CompositionType 1, fallback to client
2025-01-22 18:05:59.909 12861-12877 HostConnection          pid-12861                            D  HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_vulkan_batched_descriptor_set_update ANDROID_EMU_sync_buffer_data ANDROID_EMU_vulkan_async_qsri ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0 
2025-01-22 18:05:59.910 12861-12877 OpenGLRenderer          pid-12861                            E  Unable to match the desired swap behavior.
2025-01-22 18:05:59.981 12861-12861 unknown:BridgelessReact pid-12861                            W  ReactContext.onHostResume()
2025-01-22 18:05:59.981 12861-12861 unknown:BridgelessReact pid-12861                            W  ReactHost{0}.getOrCreateReactInstanceTask(): Executing ReactInstanceEventListeners
2025-01-22 18:05:59.981 12861-12882 unknown:BridgelessReact pid-12861                            W  ReactHost{0}.startSurface(surfaceId = 0): Execute
2025-01-22 18:05:59.998   494-513   ActivityTaskManager     system_server                        I  Displayed com.host.app/.MainActivity: +880ms
2025-01-22 18:06:00.002   494-687   Compatibil...geReporter system_server                        D  Compat change id reported: 214016041; UID 10212; state: ENABLED
2025-01-22 18:06:00.013  1024-1717  OneSearchS...stProvider com...le.android.apps.nexuslauncher  D  Shut down the binder channel
2025-01-22 18:06:00.017  1024-2200  s.nexuslauncher         com...le.android.apps.nexuslauncher  I  oneway function results for code 2 on binder at 0xb40000733c442e00 will be dropped but finished with status UNKNOWN_TRANSACTION
2025-01-22 18:06:00.019   689-898   EGL_emulation           com.android.systemui                 D  app_time_stats: avg=25663.03ms min=25663.03ms max=25663.03ms count=1
2025-01-22 18:06:00.030  1472-1847  AiAiEcho                com.google.android.as                I  Predicting[0]: 
2025-01-22 18:06:00.030  1472-1847  AiAiEcho                com.google.android.as                I  Ranked targets strategy: SORT, count: 0, ranking metadata: 
2025-01-22 18:06:00.032  1472-1847  AiAiEcho                com.google.android.as                I  #postPredictionTargets: Sending updates to UISurface lockscreen with targets# 0
2025-01-22 18:06:00.032  1472-1847  AiAiEcho                com.google.android.as                I  #postPredictionTargets: Sending updates to UISurface home with targets# 0
2025-01-22 18:06:00.032  1472-1847  AiAiEcho                com.google.android.as                I  #postPredictionTargets: Sending updates to UISurface media_data_manager with targets# 0
2025-01-22 18:06:00.057  1434-1434  GoogleInpu...hodService com...gle.android.inputmethod.latin  I  GoogleInputMethodService.onFinishInput():3227 
2025-01-22 18:06:00.058   689-689   SsMediaDataProvider     com.android.systemui                 D  Forwarding Smartspace updates []
2025-01-22 18:06:00.062  1434-1434  GoogleInpu...hodService com...gle.android.inputmethod.latin  I  GoogleInputMethodService.updateDeviceLockedStatus():2087 repeatCheckTimes = 0, unlocked = true
2025-01-22 18:06:00.062  1434-1434  GoogleInpu...hodService com...gle.android.inputmethod.latin  I  GoogleInputMethodService.onStartInput():1877 onStartInput(EditorInfo{inputType=0x0(NULL) imeOptions=0x0 privateImeOptions=null actionName=UNSPECIFIED actionLabel=null actionId=0 initialSelStart=-1 initialSelEnd=-1 initialCapsMode=0x0 hintText=null label=null packageName=com.host.app fieldId=-1 fieldName=null extras=null}, false)
2025-01-22 18:06:00.062  1434-1434  GoogleInpu...hodService com...gle.android.inputmethod.latin  I  GoogleInputMethodService.shouldHideHeaderOnInitialState():4008 ShouldHideHeaderOnInitialState = false
2025-01-22 18:06:00.064  1434-1434  GoogleInpu...hodService com...gle.android.inputmethod.latin  I  GoogleInputMethodService.updateDeviceLockedStatus():2087 repeatCheckTimes = 2, unlocked = true
2025-01-22 18:06:00.196  1159-1173  FontLog                 com.google.android.gms.persistent    I  (REDACTED) Received query %s, URI %s
2025-01-22 18:06:00.196  1159-1173  FontLog                 com.google.android.gms.persistent    I  (REDACTED) Query [%s] resolved to %s
2025-01-22 18:06:00.198  1159-1173  FontLog                 com.google.android.gms.persistent    I  (REDACTED) Fetch %s end status %s
2025-01-22 18:06:00.212  1159-1173  FontLog                 com.google.android.gms.persistent    I  (REDACTED) Pulling font file for id = %d, cache size = %d
2025-01-22 18:06:00.220  1159-1173  FontLog                 com.google.android.gms.persistent    I  (REDACTED) Pulling font file for id = %d, cache size = %d
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  Build fingerprint: 'google/sdk_gphone64_arm64/emu64a:13/TE1A.240213.009/12342917:user/release-keys'
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  Revision: '0'
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  ABI: 'arm64'
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  Timestamp: 2025-01-22 18:05:59.922341159+0700
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  Process uptime: 1s
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  Cmdline: com.host.app
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  pid: 12861, tid: 12883, name: mqt_v_js  >>> com.host.app <<<
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  uid: 10212
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  Abort message: 'terminating due to uncaught exception of type facebook::jni::JniException: com.facebook.react.common.JavascriptException: EarlyJsError: Property 'console' doesn't exist, stack:
                                                                                                    supportColor@1:184874
                                                                                                    formatter@1:185145
                                                                                                    38711@1:182750
                                                                                                    __webpack_require__@1:6728
                                                                                                    guardedWebpackRequire@1:885579
                                                                                                    33913@1:149617
                                                                                                    __webpack_require__@1:6728
                                                                                                    guardedWebpackRequire@1:885579
                                                                                                    76978@1:102091
                                                                                                    __webpack_require__@1:6728
                                                                                                    guardedWebpackRequire@1:885579
                                                                                                    73373@1:161615
                                                                                                    __webpack_require__@1:6728
                                                                                                    guardedWebpackRequire@1:885579
                                                                                                    77337@1:220449
                                                                                                    __webpack_require__@1:6728
                                                                                                    guardedWebpackRequire@1:885579
                                                                                                    anonymous@1:6593
                                                                                                    global@1:80'
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A      x0  0000000000000000  x1  0000000000003253  x2  0000000000000006  x3  0000007297148ac0
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A      x4  646277641f736766  x5  646277641f736766  x6  646277641f736766  x7  7f7f7f7f7f7f7f7f
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A      x8  00000000000000f0  x9  00000075b7249a00  x10 0000000000000001  x11 00000075b7287de4
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A      x12 00000075ca5ff020  x13 000000007fffffff  x14 0000000000b7f4d6  x15 0000017636a02722
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A      x16 00000075b72ecd58  x17 00000075b72c9c70  x18 000000729658e000  x19 000000000000323d
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A      x20 0000000000003253  x21 00000000ffffffff  x22 0000007297148bf0  x23 0000007297148c30
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A      x24 0000007297148ce0  x25 b40000737c3df103  x26 b40000737c3df101  x27 000000729714a000
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A      x28 0000007297149140  x29 0000007297148b40
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A      lr  00000075b7279968  sp  0000007297148aa0  pc  00000075b7279994  pst 0000000000001000
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A  backtrace:
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #00 pc 0000000000051994  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 4e07915368c859b1910c68c84a8de75f)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #01 pc 000000000009dd84  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libc++_shared.so (offset 0x3a0000) (BuildId: 982d68842b3bd6a164609be09a533324b1f28526)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #02 pc 000000000009ca44  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libc++_shared.so (offset 0x3a0000) (BuildId: 982d68842b3bd6a164609be09a533324b1f28526)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #03 pc 000000000009ced4  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libc++_shared.so (offset 0x3a0000) (BuildId: 982d68842b3bd6a164609be09a533324b1f28526)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #04 pc 000000000009ce74  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libc++_shared.so (offset 0x3a0000) (std::terminate()+56) (BuildId: 982d68842b3bd6a164609be09a533324b1f28526)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #05 pc 00000000003456b4  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libreactnative.so (offset 0x86c000) (BuildId: 5c0a040593ee4e3d)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #06 pc 000000000054085c  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libreactnative.so (offset 0x86c000) (BuildId: 5c0a040593ee4e3d)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #07 pc 000000000039b2b8  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libreactnative.so (offset 0x86c000) (facebook::react::JsErrorHandler::handleFatalError(facebook::jsi::Runtime&, facebook::jsi::JSError&)+5544) (BuildId: 5c0a040593ee4e3d)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #08 pc 00000000004de51c  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libreactnative.so (offset 0x86c000) (facebook::react::RuntimeScheduler_Modern::executeTask(facebook::jsi::Runtime&, facebook::react::Task&, bool) const+508) (BuildId: 5c0a040593ee4e3d)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #09 pc 00000000004ddbf4  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libreactnative.so (offset 0x86c000) (facebook::react::RuntimeScheduler_Modern::runEventLoopTick(facebook::jsi::Runtime&, facebook::react::Task&, std::__ndk1::chrono::time_point<std::__ndk1::chrono::steady_clock, std::__ndk1::chrono::duration<long long, std::__ndk1::ratio<1l, 1000000000l> > >)+108) (BuildId: 5c0a040593ee4e3d)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #10 pc 00000000004ddf60  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libreactnative.so (offset 0x86c000) (facebook::react::RuntimeScheduler_Modern::runEventLoop(facebook::jsi::Runtime&, bool)+144) (BuildId: 5c0a040593ee4e3d)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #11 pc 000000000034a020  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libreactnative.so (offset 0x86c000) (BuildId: 5c0a040593ee4e3d)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #12 pc 000000000051bb28  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libreactnative.so (offset 0x86c000) (BuildId: 5c0a040593ee4e3d)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #13 pc 0000000000019804  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libfbjni.so (offset 0x4f8000) (facebook::jni::detail::MethodWrapper<void (facebook::jni::JNativeRunnable::*)(), &(facebook::jni::JNativeRunnable::run()), facebook::jni::JNativeRunnable, void>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject*>)+72) (BuildId: a22242831a7971267de570e06121acb588ce64cd)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #14 pc 0000000000019744  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/base.apk!libfbjni.so (offset 0x4f8000) (facebook::jni::detail::FunctionWrapper<void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject*>), facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject*, void>::call(_JNIEnv*, _jobject*, void (*)(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::jni::JNativeRunnable, facebook::jni::JRunnable>::JavaPart, facebook::jni::JRunnable, void>::_javaobject*>))+60) (BuildId: a22242831a7971267de570e06121acb588ce64cd)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #15 pc 000000000001f594  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/oat/arm64/base.odex (art_jni_trampoline+116)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #16 pc 00000000004eb364  /system/framework/arm64/boot-framework.oat (android.os.Handler.dispatchMessage+84) (BuildId: 6c0704c7e551956bd93fce2e1fce5710dc8bcadf)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #17 pc 000000000020a2b0  /apex/com.android.art/lib64/libart.so (nterp_helper+4016) (BuildId: 4c9b59b74ca9272f710a71137164c349)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #18 pc 00000000002c8f58  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/oat/arm64/base.vdex (com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage+0)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #19 pc 00000000004ee708  /system/framework/arm64/boot-framework.oat (android.os.Looper.loopOnce+1032) (BuildId: 6c0704c7e551956bd93fce2e1fce5710dc8bcadf)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #20 pc 00000000004ee260  /system/framework/arm64/boot-framework.oat (android.os.Looper.loop+560) (BuildId: 6c0704c7e551956bd93fce2e1fce5710dc8bcadf)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #21 pc 0000000000209398  /apex/com.android.art/lib64/libart.so (nterp_helper+152) (BuildId: 4c9b59b74ca9272f710a71137164c349)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #22 pc 00000000002c94fe  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/oat/arm64/base.vdex (com.facebook.react.bridge.queue.MessageQueueThreadImpl.lambda$startNewBackgroundThread$2+70)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #23 pc 0000000000209334  /apex/com.android.art/lib64/libart.so (nterp_helper+52) (BuildId: 4c9b59b74ca9272f710a71137164c349)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #24 pc 00000000002c8ff0  /data/app/~~09q1i6Sd35UyDigBmVnMrw==/com.host.app-lTB238YTg1eVVqlo5956Lg==/oat/arm64/base.vdex (com.facebook.react.bridge.queue.MessageQueueThreadImpl$$ExternalSyntheticLambda1.run+4)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #25 pc 000000000017f210  /system/framework/arm64/boot.oat (java.lang.Thread.run+80) (BuildId: debc37f6712dda3ab8bc669477a0d38bc3726cb5)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #26 pc 000000000045836c  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+556) (BuildId: 4c9b59b74ca9272f710a71137164c349)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #27 pc 00000000004841e4  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+156) (BuildId: 4c9b59b74ca9272f710a71137164c349)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #28 pc 0000000000483eb0  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+400) (BuildId: 4c9b59b74ca9272f710a71137164c349)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #29 pc 00000000005cc668  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1680) (BuildId: 4c9b59b74ca9272f710a71137164c349)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #30 pc 00000000000b63b0  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208) (BuildId: 4e07915368c859b1910c68c84a8de75f)
2025-01-22 18:06:00.320 12890-12890 DEBUG                   crash_dump64                         A        #31 pc 00000000000530b8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 4e07915368c859b1910c68c84a8de75f)
2025-01-22 18:06:00.331   196-196   tombstoned              tombstoned                           E  Tombstone written to: tombstone_23

System Info

System:
  OS: macOS 14.4
  CPU: (8) arm64 Apple M1
  Memory: 112.67 MB / 16.00 GB
  Shell:
    version: 3.2.57
    path: /bin/bash
Binaries:
  Node:
    version: 22.12.0
    path: ~/.nvm/versions/node/v22.12.0/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 10.9.0
    path: ~/.nvm/versions/node/v22.12.0/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.13.0
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 32.0.0
      - 33.0.0
      - 34.0.0
      - 35.0.0
    System Images:
      - android-23 | Google APIs ARM 64 v8a
      - android-28 | Google APIs ARM 64 v8a
      - android-28 | Google ARM64-V8a Play ARM 64 v8a
      - android-29 | Google APIs ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
      - android-33 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12700392
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/local/opt/openjdk@17/bin/javac
  Ruby:
    version: 3.3.3
    path: /Users/duykhanhnguyen/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.5
    wanted: 0.76.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Re.Pack Version

5.0.0-rc.5

Reproduction

https://github.com/duynguyen250399/super-app-crashing-demo

Steps to reproduce

1. Start mini app

  • cd mfe_food && yarn && yarn start

2. Run host app in release mode

  • cd host && yarn && yarn android --mode release

Notes: I have already run adb reverse but it still not work

@duynguyen250399 duynguyen250399 added status:new New issue, not reviewed by the team yet. type:bug A bug report. labels Jan 22, 2025
@duynguyen250399 duynguyen250399 changed the title App crashing on Android with Repack v5 & Module Federation V2 App crashing on Android with Repack v5 & Module Federation V2 in release mode Jan 22, 2025
@jbroma jbroma added status:investigating The issue needs more research and information. and removed status:new New issue, not reviewed by the team yet. labels Jan 22, 2025
@atlj
Copy link

atlj commented Jan 22, 2025

Hey, I was able to reproduce this on iOS as well, it looks like something is initializing the isomorphic-rspack package before React Native can polyfill the console API.
As a quick dirty workaround, I went to node_modules/isomorphic-rslog/dist/browser/index.cjs, and added the following lines to the top of the file:

  var console = {
    log() {},
    warn() {},
    error() {},
  }

Then I used patch-package to save the patch and it now works. Please note that this is a temporary workaround until it gets fixed.

@khoingo216
Copy link

I have the same issue

@jbroma jbroma added status:confirmed The issue has been reviewed and all necessary information is provided. and removed status:investigating The issue needs more research and information. labels Jan 22, 2025
@jbroma
Copy link
Member

jbroma commented Jan 22, 2025

looks like an issue in isomorphic-rslogger more than Re.Pack itself - it's not made specifically to support React Native runtime (it uses browser entry right now).

as a workaround for now use the patching method as shown here: #891 (comment)

@duynguyen250399
Copy link
Author

@jbroma thanks for your quick response, I have applied the patch (mentioned in #891 (comment))

diff --git a/node_modules/isomorphic-rslog/dist/browser/index.cjs b/node_modules/isomorphic-rslog/dist/browser/index.cjs
index 948adab..c328dec 100644
--- a/node_modules/isomorphic-rslog/dist/browser/index.cjs
+++ b/node_modules/isomorphic-rslog/dist/browser/index.cjs
@@ -1,4 +1,11 @@
 "use strict";
+
+var console = {
+  log() {},
+  warn() {},
+  error() {},
+}
+
 var __defProp = Object.defineProperty;
 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
 var __getOwnPropNames = Object.getOwnPropertyNames;

The error com.facebook.react.common.JavascriptException: EarlyJsError: Property 'console' doesn't exist is gone but now I got this error (in logcat):

Abort message: 'terminating due to uncaught exception of type facebook::jni::JniException: com.facebook.react.common.JavascriptException: EarlyJsError: Cannot read property 'push' of undefined, stack:
                                                                                                   anonymous@1:773414
                                                                                                   anonymous@1:6293
                                                                                                   global@1:80'

The android app still crashes when I try to run in release mode

@khoingo216
Copy link

I tried the latest version(5.0.0-rc.8), and the same error occurred. Do you have any ideas about this?

ABI: 'arm64'
2025-01-23 09:24:39.664 20452-20452 DEBUG                   pid-20452                            A  Timestamp: 2025-01-23 09:24:39.447417686+0700
2025-01-23 09:24:39.664 20452-20452 DEBUG                   pid-20452                            A  Process uptime: 2s
2025-01-23 09:24:39.665 20452-20452 DEBUG                   pid-20452                            A  Cmdline: com.host.app
2025-01-23 09:24:39.665 20452-20452 DEBUG                   pid-20452                            A  pid: 20423, tid: 20443, name: mqt_v_js  >>> com.host.app <<<
2025-01-23 09:24:39.665 20452-20452 DEBUG                   pid-20452                            A  uid: 10200
2025-01-23 09:24:39.665 20452-20452 DEBUG                   pid-20452                            A  tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
2025-01-23 09:24:39.665 20452-20452 DEBUG                   pid-20452                            A  pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
2025-01-23 09:24:39.665 20452-20452 DEBUG                   pid-20452                            A  signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
2025-01-23 09:24:39.665 20452-20452 DEBUG                   pid-20452                            A  Abort message: 'terminating due to uncaught exception of type facebook::jni::JniException: com.facebook.react.common.JavascriptException: EarlyJsError: Cannot read property 'push' of undefined, stack:
                                                                                                    anonymous@1:751316
                                                                                                    anonymous@1:6281
                                                                                                    global@1:80'

Also, I tried version 4.4.1, and it works well. However, on iOS, it doesn't show any error stacks when errors occur, just a white screen.

@jbroma
Copy link
Member

jbroma commented Jan 27, 2025

@duynguyen250399 @khoingo216

I've used to repro from the first post of the issue and I've also upgraded to RC.9 of Re.Pack and it seems to work in Release Mode without a problem.

Please follow the migration guide from previous RC versions to RC7 and higher here in the release notes: https://github.com/callstack/repack/releases/tag/%40callstack%2Frepack%405.0.0-rc.7

the biggest change there is to remove CODEGEN_RULES from config.module.rules since this is now handled automatically for you. You can also remove babel-loader from dependencies since it ships with Re.Pack now.

There was also one more error that I needed to fix (and we actually report it now) - in the the mfe_food MF2 plugin config I need to change the name from mfe-food to mfeFood since the name must be a valid JS identifier (more details here: #892)

After doing all of that and running the dev-server for the mfe_food It worked on both platforms 👍

@khoingo216
Copy link

Thank @jbroma, you’re amazing!

@duynguyen250399
Copy link
Author

@jbroma Thank you so much, after upgrading to RC.9, I can run release mode in android without problem, but there's a weird thing after I remove node_modules and yarn.lock then yarn again. When I run app in debug mode (yarn start && yarn android), then this error occurs:

error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
ERROR: autolinkLibrariesFromCommand: process npx @react-native-community/cli config exited with error code: 1
Error: Cannot find module '@rspack/binding-darwin-x64'
Require stack:
- /Users/duykhanhnguyen/Projects/react-native/super-app-repack-v5/host/node_modules/@rspack/binding/binding.js
- /Users/duykhanhnguyen/Projects/react-native/super-app-repack-v5/host/node_modules/@rspack/core/dist/index.js
- /Users/duykhanhnguyen/Projects/react-native/super-app-repack-v5/host/node_modules/@callstack/repack/dist/commands/rspack/bundle.js
- /Users/duykhanhnguyen/Projects/react-native/super-app-repack-v5/host/node_modules/@callstack/repack/dist/commands/rspack/index.js
- /Users/duykhanhnguyen/Projects/react-native/super-app-repack-v5/host/node_modules/@callstack/repack/commands/rspack.js
- /Users/duykhanhnguyen/Projects/react-native/super-app-repack-v5/host/react-native.config.js
- /Users/duykhanhnguyen/Projects/react-native/super-app-repack-v5/host/node_modules/@react-native-community/cli-config/node_modules/cosmiconfig/dist/loaders.js
- /Users/duykhanhnguyen/Projects/react-native/super-app-repack-v5/host/node_modules/@react-n FAILURE: Build failed with an exception. * Where:
Settings file '/Users/duykhanhnguyen/Projects/react-native/super-app-repack-v5/host/android/settings.gradle' line: 3 * What went wrong:
A problem occurred evaluating settings 'android'.
> ERROR: autolinkLibrariesFromCommand: process npx @react-native-community/cli config exited with error code: 1 * Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org. BUILD FAILED in 13s.

Even though I run the app in android simulator with arch=arm64-v8a

I tried to install package @rspack/binding-darwin-x64 but can not because my Mac not supports x64 architecture

My settings.gradle

pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
rootProject.name = 'com.host.app'
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')

My npx react-native info:

System:
  OS: macOS 14.4
  CPU: (8) arm64 Apple M1
  Memory: 876.95 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.13.1
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 10.9.2
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.13.0
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 32.0.0
      - 33.0.0
      - 34.0.0
      - 35.0.0
    System Images:
      - android-23 | Google APIs ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
      - android-33 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12700392
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/local/opt/openjdk@17/bin/javac
  Ruby:
    version: 3.3.3
    path: /Users/duykhanhnguyen/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.5
    wanted: 0.76.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

This error also occurs in the release mode and I don't know why. I pushed new code to reproduction repository, you can try https://github.com/duynguyen250399/super-app-crashing-demo

@jbroma
Copy link
Member

jbroma commented Jan 28, 2025

@duynguyen250399 in your system info you've stated CPU: (8) arm64 Apple M1 which has arm64 in the name there so it should work. I think you might want to clean your yarn cache and global cache because this is just an error with installing the node_modules properly to me

Why do you remove your node_modules and yarn.lock? yarn.lock should be committed and managed by yarn itself and shouldn't need deleting

EDIT: I can see that the error calls for x64 and not arm64 binding which is indeed weird

@duynguyen250399
Copy link
Author

@jbroma I just removed node_modules and yarn.lock to make sure everything still works after I yarn again, but this weird error appeared and I don't know the reason why it can happen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:confirmed The issue has been reviewed and all necessary information is provided. type:bug A bug report.
Projects
None yet
Development

No branches or pull requests

4 participants