Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supporting expo.. or expo-opencv3 ? #17

Open
albjeremias opened this issue Feb 21, 2020 · 8 comments
Open

supporting expo.. or expo-opencv3 ? #17

albjeremias opened this issue Feb 21, 2020 · 8 comments

Comments

@albjeremias
Copy link

albjeremias commented Feb 21, 2020

Is there a way to run this module with expo?
When I add this module in a expo project...
`$ yarn add react-native-opencv3'

I get the error:
Unable to resolve "react-native-fs" from "node_modules/react-native-opencv3/index.js"

then I install
`$ yarn add react-native-fs'

reload again the app with expo.. and get the error:

TypeError: Cannot read property 'RNFSFileTypeRegular' of undefined
reportException @ ExceptionsManager.js:44
handleException @ ExceptionsManager.js:113
handleError @ setUpErrorHandling.js:23
_callee$ @ ErrorRecovery.fx.js:12
tryCatch @ runtime.js:45
invoke @ runtime.js:271
prototype.<computed> @ runtime.js:97
tryCatch @ runtime.js:45
invoke @ runtime.js:135
(anonymous) @ runtime.js:145
tryCallOne @ core.js:37
(anonymous) @ core.js:123
(anonymous) @ JSTimers.js:289
_callTimer @ JSTimers.js:146
_callImmediatesPass @ JSTimers.js:194
callImmediates @ JSTimers.js:458
__callImmediates @ MessageQueue.js:407
(anonymous) @ MessageQueue.js:143
__guard @ MessageQueue.js:384
flushedQueue @ MessageQueue.js:142
invokeCallbackAndReturnFlushedQueue @ MessageQueue.js:138
(anonymous) @ debuggerWorker.js:69


ExceptionsManager.js:44 Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
reportException @ ExceptionsManager.js:44
handleException @ ExceptionsManager.js:113
handleError @ setUpErrorHandling.js:23
_callee$ @ ErrorRecovery.fx.js:12
tryCatch @ runtime.js:45
invoke @ runtime.js:271
prototype.<computed> @ runtime.js:97
tryCatch @ runtime.js:45
invoke @ runtime.js:135
(anonymous) @ runtime.js:145
tryCallOne @ core.js:37
(anonymous) @ core.js:123
(anonymous) @ JSTimers.js:289
_callTimer @ JSTimers.js:146
_callImmediatesPass @ JSTimers.js:194
callImmediates @ JSTimers.js:458
__callImmediates @ MessageQueue.js:407
(anonymous) @ MessageQueue.js:143
__guard @ MessageQueue.js:384
flushedQueue @ MessageQueue.js:142
invokeCallbackAndReturnFlushedQueue @ MessageQueue.js:138
(anonymous) @ debuggerWorker.js:69
@adamgf
Copy link
Owner

adamgf commented Feb 21, 2020 via email

@goumoup
Copy link

goumoup commented Feb 21, 2020

Ok, so the issue is that react-native-fs is not supported by expo.. not react-native-opencv3...
there is also https://github.com/expo/exponent-react-native-fs would it be possible to change all calls to react-native-fs to this?

@adamgf
Copy link
Owner

adamgf commented Mar 12, 2020

Yes please change it to exponent-react-native-fs. I need help with this if others want to help out. I am too busy with other stuff to work on this.

@goumoup
Copy link

goumoup commented Mar 13, 2020

why not use opencv.js ? any reasons ? because thats the steps i took after all this troubles..

@amardeepranu
Copy link

hey @pmgou did you manage to get opencv.js running on expo?

@goumoup
Copy link

goumoup commented May 8, 2020

Hi,
in the end i make it work with a webview. not with react-native, but react-native is js so it should not be a problem.

Anyway take into account that opencvjs does not implement all the functions of opencv, only some:

https://github.com/opencv/opencv/blob/master/platforms/js/opencv_js.config.py

And most of the code is kind of reverse engineering cause there aren't examples of everything.
Here you can see how objects are created:
https://github.com/opencv/opencv/blob/master/modules/js/src/core_bindings.cpp#L595

this also helps:
https://github.com/opencv/opencv/tree/318cba4ce37319ba0b0870aab384d5dc066bb124/modules/js/test

@amardeepranu
Copy link

Thanks @pmgou what is your use case? Does that mean you launch a browser in the app, inject opencv.js and execute it inside safari/chrome within the app? Would love to see an example! Thanks

@pterosaurK
Copy link

@adamgf Finally, we also used the webview fumble to get

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants