Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Erro ao inserir o CHECKBOX

Erro ao clicar no checkbox

Invariant Violation: requireNativeComponent: "RNSVGSvgView" was not found in the UIManager.

This error is located at:
    in RNSVGSvgView (at Svg.tsx:197)
    in Svg (at styled.tsx:25)
    in Unknown (at SVGIcon.tsx:26)
    in SVGIcon
    in createdIcon
    in SizedIcon (at Checkbox.tsx:200)
    in RCTView (at View.js:116)
    in View (at styled.tsx:25)
    in Unknown (at Box/index.tsx:100)
    in Box
    in Center
    in RCTView (at View.js:116)
    in View (at styled.tsx:25)
    in Unknown (at Box/index.tsx:100)
    in Box
    in Center
    in RCTView (at View.js:116)
    in View (at styled.tsx:25)
    in Unknown (at Box/index.tsx:100)
    in Box
    in Stack
    in RCTView (at View.js:116)
    in View (at Pressable.js:339)
    in Pressable (created by Pressable)
    in Unknown (at Pressable.tsx:92)
    in Pressable
    in Unknown (at Checkbox.tsx:85)
    in Checkbox
    in RCTView (at View.js:116)
    in View (at styled.tsx:25)
    in Unknown (at Box/index.tsx:100)
    in Box
    in RCTView (at View.js:116)
    in View (at styled.tsx:25)
    in Unknown (at Box/index.tsx:100)
    in Box
    in Stack
    in VStack
    in Register (at App.tsx:10)
    in $97d95f6660b1bb14$export$9f8ac96af4b1b2ae (at NativeBaseProvider.tsx:97)
    in ToastProvider (at NativeBaseProvider.tsx:95)
    in PortalProvider (at NativeBaseProvider.tsx:94)
    in HybridProvider (at NativeBaseProvider.tsx:90)
    in ResponsiveQueryProvider (at NativeBaseProvider.tsx:89)
    in RNCSafeAreaProvider (at SafeAreaContext.tsx:76)
    in SafeAreaProvider (at NativeBaseProvider.tsx:84)
    in NativeBaseConfigProviderProvider (at NativeBaseProvider.tsx:77)
    in NativeBaseProvider (at App.tsx:8)
    in App (at withDevTools.js:18)
    in withDevTools(App) (at renderApplication.js:57)
    in RCTView (at View.js:116)
    in View (at AppContainer.js:127)
    in RCTView (at View.js:116)
    in View (at AppContainer.js:155)
    in AppContainer (at renderApplication.js:50)
    in main(RootComponent) (at renderApplication.js:67), js engine: hermes
 ERROR  Invariant Violation: requireNativeComponent: "RNSVGSvgView" was not found in the UIManager.
2 respostas
solução!

Olá, Israel.

Tudo bem?

O erro "Invariant Violation: requireNativeComponent: 'RNSVGSvgView' was not found in the UIManager" geralmente ocorre quando um componente nativo não está devidamente vinculado ao projeto.

No caso do React Native, muitos componentes dependem de bibliotecas nativas do Android ou iOS. Essas bibliotecas precisam ser vinculadas ao seu projeto para que possam ser usadas. No seu caso, parece que a biblioteca que fornece o componente "RNSVGSvgView" não está vinculada corretamente.

A biblioteca em questão é a 'react-native-svg', que é uma dependência do Native Base. Você pode tentar reinstalar essa biblioteca para resolver o problema. Aqui estão os passos que você pode seguir:

  • No terminal, navegue até a pasta do seu projeto e execute o comando:

    npm uninstall react-native-svg
    
  • Em seguida, reinstale a biblioteca com o comando:

    npm install react-native-svg
    
  • Depois de reinstalar a biblioteca, você precisa vinculá-la ao seu projeto. Se você estiver usando o React Native 0.60 ou superior, o vínculo deve ser feito automaticamente. Caso contrário, você pode precisar executar o comando react-native link react-native-svg.

  • Por fim, você precisará recompilar seu projeto. Se você estiver usando um emulador, pode precisar fechá-lo e iniciar um novo emulador após a recompilação.

  • Se não resolver, compartilha o seu código aqui com a gente.

Espero ter ajudado. Qualquer dúvida manda aqui. Bons estudos.

Obrigado Renan, deu certo!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software