ppsreejith / react-native-camera-tflite

Real time image classification with React Native and Tensorflow lite.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

example/basic project is unable to resolve module react-native-camera?

GrabbenD opened this issue · comments

Bug Report

To Do First

  • Did you try latest release?
  • Did you try master?
  • Did you look for existing matching issues?

Related Modules
RNCamera / react-native-camera

Platforms
Android

Description/Current Behaviour
I'm trying to run the example/basic project but it's unable to resolve module react-native-camera?

error: bundling failed: Error: Unable to resolve module `react-native-camera` from `/home/admin/docs/repo/react-native-camera-tflite/examples/basic/App.js`: Module `react-native-camera` does not exist in the Haste module map

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  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-*`.
    at ModuleResolver.resolveDependency (/home/admin/docs/repo/react-native-camera-tflite/examples/basic/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:209:1301)
    at ResolutionRequest.resolveDependency (/home/admin/docs/repo/react-native-camera-tflite/examples/basic/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:83:16)
    at DependencyGraph.resolveDependency (/home/admin/docs/repo/react-native-camera-tflite/examples/basic/node_modules/metro/src/node-haste/DependencyGraph.js:238:485)
    at Object.resolve (/home/admin/docs/repo/react-native-camera-tflite/examples/basic/node_modules/metro/src/lib/transformHelpers.js:180:25)
    at /home/admin/docs/repo/react-native-camera-tflite/examples/basic/node_modules/metro/src/DeltaBundler/traverseDependencies.js:311:29
    at Array.map (<anonymous>)
    at resolveDependencies (/home/admin/docs/repo/react-native-camera-tflite/examples/basic/node_modules/metro/src/DeltaBundler/traverseDependencies.js:307:16)
    at /home/admin/docs/repo/react-native-camera-tflite/examples/basic/node_modules/metro/src/DeltaBundler/traverseDependencies.js:164:33
    at Generator.next (<anonymous>)
    at step (/home/admin/docs/repo/react-native-camera-tflite/examples/basic/node_modules/metro/src/DeltaBundler/traverseDependencies.js:266:307)

Furthermore react-native-camera is not listed in package.json which is expected behavior according to the FAQ.

There is a related ticket at react-native-camera#2005 but the solution didn't work here. Deleting node_modules, /tmp/metro-bundler-cache-* and /tmp/haste-map-react-native-packager-* didn't help either.

Expected Behaviour
It should ideally work out of the box.

Steps to Reproduce

git clone https://github.com/ppsreejith/react-native-camera-tflite.git
yarn install
cd examples/basic
yarn install
yarn clear
yarn react-native run-android

I used a Pixel 3a with API 26 since it has the same API level as build.gradle in the example/basic.