0

在我的应用程序中,所有 UI 都采用 JS 中的本机和业务逻辑。我正在从我的 android 应用程序类启动一个非 UI 组件,它工作正常,直到我将 react 和 react-native 从 0.61.2 更新到 0.67.2 并将反应 16.9.0 更新到 17.0.2。我现在面临的问题是以下调用无法启动 react-native 组件,并且我无法向 JS 发出事件。

  mReactRootView = new ReactRootView(getApplicationContext());
    mReactInstanceManager = ReactInstanceManager.builder()
        .setApplication((this))
        .setBundleAssetName("index.android.bundle")
        .setJSMainModulePath("index.android")
        .addPackage(new MainReactPackage())
        .addPackage(new MyPackagePackage())
        .setUseDeveloperSupport(BuildConfig.DEBUG)
        .setInitialLifecycleState(LifecycleState.BEFORE_CREATE)
        .build();
    mReactRootView.startReactApplication(mReactInstanceManager, "NonUIModule", null);

除了以下之外,logcat 中没有错误:

2022-02-17 09:28:56.346 7426-7426/com.auditchecknew D/SoLoader: init start
2022-02-17 09:28:56.346 7426-7426/com.auditchecknew D/SoLoader: adding system library source: /vendor/lib64
2022-02-17 09:28:56.346 7426-7426/com.auditchecknew D/SoLoader: adding system library source: /system/lib64
2022-02-17 09:28:56.347 7426-7426/com.auditchecknew D/SoLoader: adding application source: com.facebook.soloader.DirectorySoSource[root = /data/app/~~eX9NrGIND2CTgtG8rKio8g==/com.auditchecknew-dDhouF4mcjw5YhMT4fj7Ag==/lib/x86_64 flags = 0]
2022-02-17 09:28:56.348 7426-7426/com.auditchecknew D/SoLoader: adding backup source from : com.facebook.soloader.ApkSoSource[root = /data/data/com.auditchecknew/lib-main flags = 1]
2022-02-17 09:28:56.348 7426-7426/com.auditchecknew D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2]
2022-02-17 09:28:56.348 7426-7426/com.auditchecknew D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2]
2022-02-17 09:28:56.348 7426-7426/com.auditchecknew D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /data/app/~~eX9NrGIND2CTgtG8rKio8g==/com.auditchecknew-dDhouF4mcjw5YhMT4fj7Ag==/lib/x86_64 flags = 0]
2022-02-17 09:28:56.348 7426-7426/com.auditchecknew D/SoLoader: Preparing SO source: com.facebook.soloader.ApkSoSource[root = /data/data/com.auditchecknew/lib-main flags = 1]
2022-02-17 09:28:56.349 7426-7426/com.auditchecknew V/fb-UnpackingSoSource: locked dso store /data/user/0/com.auditchecknew/lib-main
2022-02-17 09:28:56.351 7426-7426/com.auditchecknew I/fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.auditchecknew/lib-main
2022-02-17 09:28:56.351 7426-7426/com.auditchecknew V/fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.auditchecknew/lib-main
2022-02-17 09:28:56.351 7426-7426/com.auditchecknew D/SoLoader: init finish: 4 SO sources prepared
2022-02-17 09:28:56.351 7426-7426/com.auditchecknew D/SoLoader: init exiting
2022-02-17 09:28:56.361 7426-7426/com.auditchecknew D/SoLoader: init exiting
2022-02-17 09:28:56.361 7426-7426/com.auditchecknew D/SoLoader: About to load: libjscexecutor.so
2022-02-17 09:28:56.362 7426-7426/com.auditchecknew D/SoLoader: libjscexecutor.so not found on /data/data/com.auditchecknew/lib-main
2022-02-17 09:28:56.362 7426-7426/com.auditchecknew D/SoLoader: libjscexecutor.so found on /data/app/~~eX9NrGIND2CTgtG8rKio8g==/com.auditchecknew-dDhouF4mcjw5YhMT4fj7Ag==/lib/x86_64
2022-02-17 09:28:56.362 7426-7426/com.auditchecknew D/SoLoader: Not resolving dependencies for libjscexecutor.so
2022-02-17 09:28:56.388 7426-7426/com.auditchecknew D/JavaScriptCore.Version: 250230.2.1
2022-02-17 09:28:56.388 7426-7426/com.auditchecknew D/SoLoader: Loaded: libjscexecutor.so
2022-02-17 09:28:56.389 7426-7426/com.auditchecknew D/SoLoader: init exiting
2022-02-17 09:28:56.461 7426-7457/com.auditchecknew D/libEGL: loaded /vendor/lib64/egl/libEGL_emulation.so
2022-02-17 09:28:56.463 7426-7457/com.auditchecknew D/libEGL: loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
2022-02-17 09:28:56.467 7426-7457/com.auditchecknew D/libEGL: loaded /vendor/lib64/egl/libGLESv2_emulation.so
2022-02-17 09:28:56.506 7426-7426/com.auditchecknew W/m.auditcheckne: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (unsupported, reflection, allowed)
2022-02-17 09:28:56.506 7426-7426/com.auditchecknew W/m.auditcheckne: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (unsupported, reflection, allowed)
2022-02-17 09:28:56.530 7426-7455/com.auditchecknew D/HostConnection: createUnique: call
2022-02-17 09:28:56.532 7426-7455/com.auditchecknew D/HostConnection: HostConnection::get() New Host Connection established 0x7804f8778390, tid 7455
2022-02-17 09:28:56.538 7426-7455/com.auditchecknew D/HostConnection: 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_async_unmap_buffer 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_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0 
2022-02-17 09:28:56.540 7426-7455/com.auditchecknew W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2022-02-17 09:28:56.540 7426-7455/com.auditchecknew W/OpenGLRenderer: Failed to initialize 101010-2 format, error = EGL_SUCCESS
2022-02-17 09:28:56.543 7426-7455/com.auditchecknew D/EGL_emulation: eglCreateContext: 0x7804f8777d90: maj 3 min 0 rcv 3
2022-02-17 09:28:56.545 7426-7455/com.auditchecknew D/EGL_emulation: eglMakeCurrent: 0x7804f8777d90: ver 3 0 (tinfo 0x780718a00080) (first time)
2022-02-17 09:28:56.554 7426-7455/com.auditchecknew I/Gralloc4: mapper 4.x is not supported
2022-02-17 09:28:56.555 7426-7455/com.auditchecknew D/HostConnection: createUnique: call
2022-02-17 09:28:56.555 7426-7455/com.auditchecknew D/HostConnection: HostConnection::get() New Host Connection established 0x7804f8776110, tid 7455
2022-02-17 09:28:56.556 7426-7455/com.auditchecknew D/goldfish-address-space: allocate: Ask for block of size 0x100
2022-02-17 09:28:56.556 7426-7455/com.auditchecknew D/goldfish-address-space: allocate: ioctl allocate returned offset 0x3efffe000 size 0x2000
2022-02-17 09:28:56.586 7426-7455/com.auditchecknew W/Gralloc4: allocator 4.x is not supported
2022-02-17 09:28:56.610 7426-7455/com.auditchecknew D/HostConnection: 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_async_unmap_buffer 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_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0 
2022-02-17 09:28:56.742 7426-7469/com.auditchecknew D/SoLoader: About to load: libreactnativejni.so
2022-02-17 09:28:56.743 7426-7469/com.auditchecknew D/SoLoader: libreactnativejni.so not found on /data/data/com.auditchecknew/lib-main
2022-02-17 09:28:56.743 7426-7469/com.auditchecknew D/SoLoader: libreactnativejni.so found on /data/app/~~eX9NrGIND2CTgtG8rKio8g==/com.auditchecknew-dDhouF4mcjw5YhMT4fj7Ag==/lib/x86_64
2022-02-17 09:28:56.743 7426-7469/com.auditchecknew D/SoLoader: Not resolving dependencies for libreactnativejni.so
2022-02-17 09:28:56.744 7426-7469/com.auditchecknew D/SoLoader: Loaded: libreactnativejni.so
2022-02-17 09:28:56.744 7426-7469/com.auditchecknew D/SoLoader: About to load: libfbjni.so
2022-02-17 09:28:56.744 7426-7469/com.auditchecknew D/SoLoader: libfbjni.so not found on /data/data/com.auditchecknew/lib-main
2022-02-17 09:28:56.745 7426-7469/com.auditchecknew D/SoLoader: libfbjni.so found on /data/app/~~eX9NrGIND2CTgtG8rKio8g==/com.auditchecknew-dDhouF4mcjw5YhMT4fj7Ag==/lib/x86_64
2022-02-17 09:28:56.745 7426-7469/com.auditchecknew D/SoLoader: Not resolving dependencies for libfbjni.so
2022-02-17 09:28:56.745 7426-7469/com.auditchecknew D/SoLoader: Loaded: libfbjni.so
2022-02-17 09:28:56.761 7426-7469/com.auditchecknew W/unknown:ReactContext: initializeMessageQueueThreads() is called.
2022-02-17 09:28:56.769 7426-7426/com.auditchecknew W/unknown:ReactNative: Packager connection already open, nooping.
2022-02-17 09:28:56.911 7426-7471/com.auditchecknew D/SoLoader: About to load: libreactnativeblob.so
2022-02-17 09:28:56.911 7426-7471/com.auditchecknew D/SoLoader: libreactnativeblob.so not found on /data/data/com.auditchecknew/lib-main
2022-02-17 09:28:56.912 7426-7471/com.auditchecknew D/SoLoader: libreactnativeblob.so found on /data/app/~~eX9NrGIND2CTgtG8rKio8g==/com.auditchecknew-dDhouF4mcjw5YhMT4fj7Ag==/lib/x86_64
2022-02-17 09:28:56.912 7426-7471/com.auditchecknew D/SoLoader: Not resolving dependencies for libreactnativeblob.so
2022-02-17 09:28:56.912 7426-7471/com.auditchecknew D/SoLoader: Loaded: libreactnativeblob.so
2022-02-17 09:28:56.925 7426-7426/com.auditchecknew E/unknown:ReactNative: Unable to launch logbox because react was unable to create the root view
2022-02-17 09:28:56.926 7426-7472/com.auditchecknew I/WebViewFactory: Loading com.google.android.webview version 91.0.4472.114 (code 447211487)
2022-02-17 09:28:56.968 7426-7472/com.auditchecknew W/m.auditcheckne: Accessing hidden method Landroid/os/Trace;->isTagEnabled(J)Z (unsupported, reflection, allowed)
2022-02-17 09:28:56.968 7426-7472/com.auditchecknew W/m.auditcheckne: Accessing hidden method Landroid/os/Trace;->traceBegin(JLjava/lang/String;)V (unsupported, reflection, allowed)
2022-02-17 09:28:56.968 7426-7472/com.auditchecknew W/m.auditcheckne: Accessing hidden method Landroid/os/Trace;->traceEnd(J)V (unsupported, reflection, allowed)
2022-02-17 09:28:56.968 7426-7472/com.auditchecknew W/m.auditcheckne: Accessing hidden method Landroid/os/Trace;->asyncTraceBegin(JLjava/lang/String;I)V (unsupported, reflection, allowed)
2022-02-17 09:28:56.968 7426-7472/com.auditchecknew W/m.auditcheckne: Accessing hidden method Landroid/os/Trace;->asyncTraceEnd(JLjava/lang/String;I)V (unsupported, reflection, allowed)
2022-02-17 09:28:56.985 7426-7472/com.auditchecknew I/cr_LibraryLoader: Loaded native library version number "91.0.4472.114"
2022-02-17 09:28:56.986 7426-7472/com.auditchecknew I/cr_CachingUmaRecorder: Flushed 4 samples from 4 histograms.
2022-02-17 09:28:56.986 7426-7483/com.auditchecknew I/cr_VariationsUtils: Failed reading seed file "/data/user/0/com.auditchecknew/app_webview/variations_seed_new"
2022-02-17 09:28:56.987 7426-7483/com.auditchecknew I/cr_VariationsUtils: Failed reading seed file "/data/user/0/com.auditchecknew/app_webview/variations_seed"
2022-02-17 09:28:56.995 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
2022-02-17 09:28:56.998 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
2022-02-17 09:28:57.002 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
2022-02-17 09:28:57.005 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager
2022-02-17 09:28:57.006 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
2022-02-17 09:28:57.007 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
2022-02-17 09:28:57.009 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
2022-02-17 09:28:57.011 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager
2022-02-17 09:28:57.013 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager$ReactSliderShadowNode
2022-02-17 09:28:57.014 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
2022-02-17 09:28:57.016 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
2022-02-17 09:28:57.017 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
2022-02-17 09:28:57.019 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
2022-02-17 09:28:57.020 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
2022-02-17 09:28:57.021 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
2022-02-17 09:28:57.023 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
2022-02-17 09:28:57.024 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
2022-02-17 09:28:57.024 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
2022-02-17 09:28:57.024 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextShadowNode
2022-02-17 09:28:57.025 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
2022-02-17 09:28:57.029 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode
2022-02-17 09:28:57.031 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
2022-02-17 09:28:57.033 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode
2022-02-17 09:28:57.034 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
2022-02-17 09:28:57.036 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
2022-02-17 09:28:57.036 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextShadowNode
2022-02-17 09:28:57.037 7426-7471/com.auditchecknew W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.unimplementedview.ReactUnimplementedViewManager
4

0 回答 0