1

Boa tarde,

Estou recebendo um erro sempre que executo o comando "react-native run-android" para iniciar minha primeira aplicação no AVD com a versão 6.0 do android. Sou iniciante em React Native, e gostaria de ajuda sobre o assunto.

Segui os passos conforme esse tutorial pede.

Erro que recebo na tela do smartphone emulado:

The development server returned response error code: 500

URL: http://10.0.2.2:8081/index.delta?platform=android&dev=true&minify=false

Body:
{"originModulePath":"C:\\Users\\neto_\\Google Drive\\Projetos\\ReactNative\\CozinheAgora\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js","targetModuleName":"AccessibilityInfo","message":"Unable to resolve module `AccessibilityInfo` from `C:\\Users\\neto_\\Google Drive\\Projetos\\ReactNative\\CozinheAgora\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js`: Module `AccessibilityInfo` does not exist in the Haste module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n  1. Clear watchman watches: `watchman watch-del-all`.\n  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\n  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.","errors":[{"description":"Unable to resolve module `AccessibilityInfo` from `C:\\Users\\neto_\\Google Drive\\Projetos\\ReactNative\\CozinheAgora\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js`: Module `AccessibilityInfo` does not exist in the Haste module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n  1. Clear watchman watches: `watchman watch-del-all`.\n  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\n  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`."}],"name":"Error","stack":"Error: Unable to resolve module `AccessibilityInfo` from `C:\\Users\\neto_\\Google Drive\\Projetos\\ReactNative\\CozinheAgora\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js`: Module `AccessibilityInfo` does not exist in the Haste module map\n\nThis might be related to https://github.com/facebook/react-native/issues/4968\nTo resolve try the following:\n  1. Clear watchman watches: `watchman watch-del-all`.\n  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.\n  3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.  4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`.\n    at ModuleResolver.resolveDependency (C:\\Users\\neto_\\Google Drive\\Projetos\\ReactNative\\CozinheAgora\\node_modules\\metro\\src\\node-haste\\DependencyGraph\\ModuleResolution.js:167:1306)\n    at ResolutionRequest.resolveDependency (C:\\Users\\neto_\\Google Drive\\Projetos\\ReactNative\\CozinheAgora\\node_modules\\metro\\src\\node-haste\\DependencyGraph\\ResolutionRequest.js:80:16)\n    at DependencyGraph.resolveDependency (C:\\Users\\neto_\\Google Drive\\Projetos\\ReactNative\\CozinheAgora\\node_modules\\metro\\src\\node-haste\\DependencyGraph.js:237:485)\n    at Object.resolve (C:\\Users\\neto_\\Google Drive\\Projetos\\ReactNative\\CozinheAgora\\node_modules\\metro\\src\\lib\\transformHelpers.js:116:25)\n    at dependencies.map.result (C:\\Users\\neto_\\Google Drive\\Projetos\\ReactNative\\CozinheAgora\\node_modules\\metro\\src\\DeltaBundler\\traverseDependencies.js:298:29)\n    at Array.map (<anonymous>)\n    at resolveDependencies (C:\\Users\\neto_\\Google Drive\\Projetos\\ReactNative\\CozinheAgora\\node_modules\\metro\\src\\DeltaBundler\\traverseDependencies.js:294:16)\n    at C:\\Users\\neto_\\Google Drive\\Projetos\\ReactNative\\CozinheAgora\\node_modules\\metro\\src\\DeltaBundler\\traverseDependencies.js:159:33\n    at Generator.next (<anonymous>)\n    at step (C:\\Users\\neto_\\Google Drive\\Projetos\\ReactNative\\CozinheAgora\\node_modules\\metro\\src\\DeltaBundler\\traverseDependencies.js:239:307)"}
processBundleResult
    BundleDownloader.java:285
access$200
    BundleDownloader.java:37
onResponse
    BundleDownloader.java:163
execute
    RealCall.java:153
run
    NamedRunnable.java:32
runWorker
    ThreadPoolExecutor.java:1113
run
    ThreadPoolExecutor.java:588
run
    Thread.java:818
2
  • Qual a versão do seu react-native? Commented 31/08/2018 às 16:39
  • react-native-cli: 2.0.1 e react-native: 0.56.0 @ThiagoTibau
    – Neto
    Commented 31/08/2018 às 17:13

1 Resposta 1

0

Existem 5 possíveis soluções:

  • Atualize seu react-native, algumas versões tem conflito com windows;
  • Faça downgrade do seu react-native: Se o seu RN já estiver atualizado, faça downgrade, tem algumas versões que tem conflito com windows.
  • Reunicie seu computador: pode parecer ridículo, porém, já tive esse erro que foi resolvido com o reinicio do computador;
  • Apague a pasta node_modules: apague ela e reinstale os pacotes com o npm install ou yarn install
  • Realize os passos citados no erro:

    1. Clear watchman watches: watchman watch-del-all.
    2. Delete the node_modules folder: rm -rf node_modules && npm install.
    3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache.
    4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*
3
  • Tentei seguir todos os passos, mas continuo recebendo o mesmo erro.
    – Neto
    Commented 31/08/2018 às 17:15
  • Resolvi, fiz um downgrade da versão 0.56.0 para a 0.55.x do react-native e do babel para 4.x.x
    – Neto
    Commented 31/08/2018 às 17:38
  • A versão 0.55 e a 0.54 se não me engano tem conflito com o windows! Se puder marca a resposta ai! Abraços! Commented 31/08/2018 às 17:56

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .