reactnativecn / react-native-website

React Native 中文网
https://reactnative.cn
MIT License
216 stars 327 forks source link

安装导航包后打包下载到手机上闪退 #747

Closed 3283615145 closed 10 months ago

3283615145 commented 10 months ago

请按以下格式提供问题的相关信息。

问题的具体描述

npx create-expo-app project创建项目,打包能正常运行,安装npm install @react-navigation/native和npm install @react-navigation/native-stack包后,写相关导航,打包下载到手机闪退

请描述完整的环境/版本信息

预期结果

解决打包闪退

sunnylqm commented 10 months ago

打包闪退需要抓adb logcat看具体跳出的异常 一般常见的问题是访问了http的接口(release默认只支持https接口)

3283615145 commented 10 months ago

08-30 10:10:26.975 8270 8322 E ReactNativeJS: Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager. 08-30 10:10:26.975 8270 8322 E ReactNativeJS: 08-30 10:10:26.975 8270 8322 E ReactNativeJS: This error is located at: 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RNSScreenStackHeaderConfig 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in HeaderConfig 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RNSScreen 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Unknown 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Suspender 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Suspense 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Freeze 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in DelayedFreeze 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in InnerScreen 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Screen 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in SceneView 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Suspender 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Suspense 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Freeze 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in DelayedFreeze 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RNSScreenStack 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in ScreenStack 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in NativeStackViewInner 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RNCSafeAreaProvider 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in SafeAreaProvider 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in SafeAreaProviderCompat 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in NativeStackView 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in PreventRemoveProvider 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in NavigationContent 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Unknown 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in NativeStackNavigator 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in EnsureSingleNavigator 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in BaseNavigationContainer 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in ThemeProvider 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in NavigationContainerInner 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RCTView 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Unknown 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Nav 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RCTView 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Unknown 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RCTView 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Unknown 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in AppContainer, js engine: hermes 08-30 10:10:26.975 8270 8322 E ReactNativeJS: Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager. 08-30 10:10:26.975 8270 8322 E ReactNativeJS: 08-30 10:10:26.975 8270 8322 E ReactNativeJS: This error is located at: 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RNSScreenStackHeaderConfig 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in HeaderConfig 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RNSScreen 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Unknown 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Suspender 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Suspense 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Freeze 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in DelayedFreeze 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in InnerScreen 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Screen 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in SceneView 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Suspender 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Suspense 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Freeze 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in DelayedFreeze 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RNSScreenStack 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in ScreenStack 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in NativeStackViewInner 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RNCSafeAreaProvider 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in SafeAreaProvider 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in SafeAreaProviderCompat 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in NativeStackView 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in PreventRemoveProvider 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in NavigationContent 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Unknown 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in NativeStackNavigator 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in EnsureSingleNavigator 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in BaseNavigationContainer 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in ThemeProvider 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in NavigationContainerInner 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RCTView 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Unknown 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Nav 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RCTView 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Unknown 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in RCTView 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in Unknown 08-30 10:10:26.975 8270 8322 E ReactNativeJS: in AppContainer, js engine: hermes 08-30 10:10:26.979 1485 1770 E AwareLog: CpuHighFgControl: getContentWithOneLine file not exists or canot read! 08-30 10:10:26.982 1485 2061 D InputDispatcher: Window handle WindowManager has no registered input channel 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager. 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: This error is located at: 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in RNSScreenStackHeaderConfig 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in HeaderConfig 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in RNSScreen 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in Unknown 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in Suspender 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in Suspense 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in Freeze 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in DelayedFreeze 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in InnerScreen 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in Screen 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in SceneView 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in Suspender 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in Suspense 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in Freeze 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in DelayedFreeze 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in RNSScreenStack 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in ScreenStack 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in NativeStackViewInner 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in RNCSafeAreaProvider 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in SafeAreaProvider 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in SafeAreaProviderCompat 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in NativeStackView 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in PreventRemoveProvider 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in NavigationContent 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in Unknown 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in NativeStackNavigator 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in EnsureSingleNavigator 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in BaseNavigationContainer 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in ThemeProvider 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in NavigationContainerInner 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in RCTView 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in Unknown 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in Nav 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in RCTView 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in Unknown 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in RCTView 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in Unknown 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: in AppContainer, js engine: hermes, stack: 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: invariant@1:38401 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: getNativeComponentAttributes@1:66183 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: anonymous@1:274234 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: anonymous@1:62107 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: completeWork@1:321075 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: completeUnitOfWork@1:333810 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: performUnitOfWork@1:333655 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: workLoopSync@1:333523 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: renderRootSync@1:333407 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: performSyncWorkOnRoot@1:330897 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: flushSyncCallbacks@1:296194 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: scheduleUpdateOnFiber@1:328366 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: updateContainer@1:338764 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: anonymous@1:347815 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: renderElement@1:43616 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: renderApplication@1:255615 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: run@1:248708 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: runApplication@1:249174 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: callFunction@1:47271 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: anonymous@1:45769 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: guard@1:46706 08-30 10:10:26.983 8270 8323 E unknown:ReactNative: callFunctionReturnFlushedQueue@1:45727 08-30 10:10:26.985 1485 1770 E AwareLog: CpuHighFgControl: getContentWithOneLine file not exists or canot read! 08-30 10:10:26.986 8270 8323 I QarthLog: [PatchStore] createDisableExceptionQarthFile 08-30 10:10:26.986 8270 8323 I QarthLog: [PatchStore] create disable file for com.wcy0422.testcs uid is 10269 08-30 10:10:26.986 8270 8323 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules 08-30 10:10:26.986 8270 8323 E AndroidRuntime: Process: com.wcy0422.testcs, PID: 8270 08-30 10:10:26.986 8270 8323 E AndroidRuntime: com.facebook.react.common.JavascriptException: Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager. 08-30 10:10:26.986 8270 8323 E AndroidRuntime: 08-30 10:10:26.986 8270 8323 E AndroidRuntime: This error is located at: 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in RNSScreenStackHeaderConfig 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in HeaderConfig 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in RNSScreen 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in Unknown 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in Suspender 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in Suspense 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in Freeze 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in DelayedFreeze 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in InnerScreen 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in Screen 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in SceneView 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in Suspender 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in Suspense 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in Freeze 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in DelayedFreeze 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in RNSScreenStack 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in ScreenStack 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in NativeStackViewInner 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in RNCSafeAreaProvider 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in SafeAreaProvider 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in SafeAreaProviderCompat 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in NativeStackView 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in PreventRemoveProvider 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in NavigationContent 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in Unknown 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in NativeStackNavigator 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in EnsureSingleNavigator 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in BaseNavigationContainer 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in ThemeProvider 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in NavigationContainerInner 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in RCTView 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in Unknown 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in Nav 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in RCTView 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in Unknown 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in RCTView 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in Unknown 08-30 10:10:26.986 8270 8323 E AndroidRuntime: in AppContainer, js engine: hermes, stack: 08-30 10:10:26.986 8270 8323 E AndroidRuntime: invariant@1:38401 08-30 10:10:26.986 8270 8323 E AndroidRuntime: getNativeComponentAttributes@1:66183 08-30 10:10:26.986 8270 8323 E AndroidRuntime: anonymous@1:274234 08-30 10:10:26.986 8270 8323 E AndroidRuntime: anonymous@1:62107 08-30 10:10:26.986 8270 8323 E AndroidRuntime: completeWork@1:321075 08-30 10:10:26.986 8270 8323 E AndroidRuntime: completeUnitOfWork@1:333810 08-30 10:10:26.986 8270 8323 E AndroidRuntime: performUnitOfWork@1:333655 08-30 10:10:26.986 8270 8323 E AndroidRuntime: workLoopSync@1:333523 08-30 10:10:26.986 8270 8323 E AndroidRuntime: renderRootSync@1:333407 08-30 10:10:26.986 8270 8323 E AndroidRuntime: performSyncWorkOnRoot@1:330897 08-30 10:10:26.986 8270 8323 E AndroidRuntime: flushSyncCallbacks@1:296194 08-30 10:10:26.986 8270 8323 E AndroidRuntime: scheduleUpdateOnFiber@1:328366 08-30 10:10:26.986 8270 8323 E AndroidRuntime: updateContainer@1:338764 08-30 10:10:26.986 8270 8323 E AndroidRuntime: anonymous@1:347815 08-30 10:10:26.986 8270 8323 E AndroidRuntime: renderElement@1:43616 08-30 10:10:26.986 8270 8323 E AndroidRuntime: renderApplication@1:255615 08-30 10:10:26.986 8270 8323 E AndroidRuntime: run@1:248708 08-30 10:10:26.986 8270 8323 E AndroidRuntime: runApplication@1:249174 08-30 10:10:26.986 8270 8323 E AndroidRuntime: callFunction@1:47271 08-30 10:10:26.986 8270 8323 E AndroidRuntime: anonymous@1:45769 08-30 10:10:26.986 8270 8323 E AndroidRuntime: guard@1:46706 08-30 10:10:26.986 8270 8323 E AndroidRuntime: callFunctionReturnFlushedQueue@1:45727 08-30 10:10:26.986 8270 8323 E AndroidRuntime: 08-30 10:10:26.986 8270 8323 E AndroidRuntime: at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:65) 08-30 10:10:26.986 8270 8323 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 08-30 10:10:26.986 8270 8323 E AndroidRuntime: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372) 08-30 10:10:26.986 8270 8323 E AndroidRuntime: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188) 08-30 10:10:26.986 8270 8323 E AndroidRuntime: at com.facebook.jni.NativeRunnable.run(Native Method) 08-30 10:10:26.986 8270 8323 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:900) 08-30 10:10:26.986 8270 8323 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:103) 08-30 10:10:26.986 8270 8323 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
08-30 10:10:26.986 8270 8323 E AndroidRuntime: at android.os.Looper.loop(Looper.java:219) 08-30 10:10:26.986 8270 8323 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228) 08-30 10:10:26.986 8270 8323 E AndroidRuntime: at java.lang.Thread.run(Thread.java:929) 这个是什么问题呀

sunnylqm commented 10 months ago

没有安装react-native-screens?