Expo react native — приложение работает в веб-браузере, но не в приложении для Android expo: Инвариантное нарушение:

#javascript #android #reactjs #react-native #expo

Вопрос:

Я создаю приложение с помощью визуального кода react native с помощью expo — приложение отлично работает в веб-браузере, но когда я сканирую QR-код в приложении expo на своем телефоне Android, я получаю эту ошибку. Я пытался создавать новые проекты, удалять и переустановить npm, но все безрезультатно. Я не могу найти в Интернете ни одного примера, в котором была бы подобная проблема.

У кого-нибудь была подобная проблема?

Это сообщение об ошибке в терминале:

 Invariant Violation: View config getter callback for component `path` must be a function (received `undefined`). Make sure to start component names with a capital letter.

This error is located at:
    in path
    in svg (created by ForwardRef(SvgIcon))
    in ForwardRef(SvgIcon) (created by WithStyles(ForwardRef(SvgIcon)))
    in WithStyles(ForwardRef(SvgIcon)) (created by ForwardRef(AddIcon))
    in ForwardRef(AddIcon)
    in ForwardRef(AddIcon) (at PlaylistScreen.js:79)
    in span (created by ForwardRef(Fab))
    in button (created by ForwardRef(ButtonBase))
    in ForwardRef(ButtonBase) (created by WithStyles(ForwardRef(ButtonBase)))
    in WithStyles(ForwardRef(ButtonBase)) (created by ForwardRef(Fab))
    in ForwardRef(Fab) (created by WithStyles(ForwardRef(Fab)))
    in WithStyles(ForwardRef(Fab)) (at PlaylistScreen.js:74)
    in RCTView (at View.js:34)
    in View (at PlaylistScreen.js:11)
    in PlaylistScreen (at SceneView.tsx:126)
    in StaticContainer
    in StaticContainer (at SceneView.tsx:119)
    in EnsureSingleNavigator (at SceneView.tsx:118)
    in SceneView (at useDescriptors.tsx:209)
    in RCTView (at View.js:34)
    in View (at Screen.tsx:63)
    in RCTView (at View.js:34)
    in View (at Background.tsx:13)
    in Background (at Screen.tsx:58)
    in Screen (at BottomTabView.tsx:129)
    in RNSScreen (at createAnimatedComponent.js:165)
    in AnimatedComponent (at createAnimatedComponent.js:215)
    in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:147)
    in Screen (at ScreenFallback.tsx:37)
    in MaybeScreen (at BottomTabView.tsx:122)
    in RNSScreenContainer (at src/index.native.tsx:186)
    in ScreenContainer (at ScreenFallback.tsx:28)
    in MaybeScreenContainer (at BottomTabView.tsx:93)
    in RNCSafeAreaProvider (at SafeAreaContext.tsx:76)
    in SafeAreaProvider (at SafeAreaProviderCompat.tsx:46)
    in SafeAreaProviderCompat (at BottomTabView.tsx:92)
    in BottomTabView (at createBottomTabNavigator.tsx:112)
    in Unknown (at createBottomTabNavigator.tsx:111)
    in BottomTabNavigator (at MainContainer.js:23)
    in EnsureSingleNavigator (at BaseNavigationContainer.tsx:429)
    in ForwardRef(BaseNavigationContainer) (at NavigationContainer.tsx:132)
    in ThemeProvider (at NavigationContainer.tsx:131)
    in ForwardRef(NavigationContainerInner) (at MainContainer.js:22)
    in MainContainer (at App.js:7)
    in App (created by ExpoRoot)
    in ExpoRoot (at renderApplication.js:45)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:106)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:132)
    in AppContainer (at renderApplication.js:39)
at node_modulesreact-nativeLibrariesLogBoxLogBox.js:148:8 in registerError
at node_modulesreact-nativeLibrariesLogBoxLogBox.js:59:8 in errorImpl
at node_modulesreact-nativeLibrariesLogBoxLogBox.js:33:4 in console.error
at node_modulesexpobuildenvironmentreact-native-logs.fx.js:27:4 in error
at node_modulesreact-nativeLibrariesCoreExceptionsManager.js:104:6 in reportException
at node_modulesreact-nativeLibrariesCoreExceptionsManager.js:171:19 in handleException
at node_modulesreact-nativeLibrariesCoresetUpErrorHandling.js:24:6 in handleError
at node_modulesexpo-error-recoverybuildErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0
at node_modulesregenerator-runtimeruntime.js:63:36 in tryCatch
at node_modulesregenerator-runtimeruntime.js:294:29 in invoke
at node_modulesregenerator-runtimeruntime.js:63:36 in tryCatch
at node_modulesregenerator-runtimeruntime.js:155:27 in invoke
at node_modulesregenerator-runtimeruntime.js:165:18 in PromiseImpl.resolve.then$argument_0
at node_modulesreact-nativenode_modulespromisesetimmediatecore.js:37:13 in tryCallOne
at node_modulesreact-nativenode_modulespromisesetimmediatecore.js:123:24 in setImmediate$argument_0
at node_modulesreact-nativeLibrariesCoreTimersJSTimers.js:130:14 in _callTimer
at node_modulesreact-nativeLibrariesCoreTimersJSTimers.js:181:14 in _callImmediatesPass
at node_modulesreact-nativeLibrariesCoreTimersJSTimers.js:441:30 in callImmediates
at node_modulesreact-nativeLibrariesBatchedBridgeMessageQueue.js:387:6 in __callImmediates
at node_modulesreact-nativeLibrariesBatchedBridgeMessageQueue.js:135:6 in __guard$argument_0
at node_modulesreact-nativeLibrariesBatchedBridgeMessageQueue.js:364:10 in __guard
at node_modulesreact-nativeLibrariesBatchedBridgeMessageQueue.js:134:4 in flushedQueue
 

Я создаю приложение с помощью react native в визуальном коде с помощью expo — приложение отлично работает в веб-браузере, но когда я сканирую QR-код в приложении expo на своем телефоне Android, я получаю эту ошибку.

Комментарии:

1. Я рад поделиться своим кодом, если это необходимо

2. Вы не можете использовать теги только HTML с помощью React native. Используйте это: github.com/react-native-svg/react-native-svg для отображения SVG.