ludo / react-native-torch

Torch (flashlight) plugin for React Native (Android/iOS)
MIT License
78 stars 27 forks source link

Doesn't work on Android 5.0 lollipop #3

Closed basilwood closed 6 years ago

basilwood commented 6 years ago

Added permission for camera and flashlight in Androidmanifest.xml still, the flashlight doesn't turn ON on lollipop. Couldn't check on Android 5.1 but works above marshmallow.

ludo commented 6 years ago

Could you try with beta version 1.1.0: npm install react-native-torch@next? Older versions of this package only worked with Android >= 6, but version 1.1.0 should support older Android versions. Let me know if this helps!

basilwood commented 6 years ago

Hi I tried the beta version. Now I get this error "Loading dependency graph, done. Bundling index.js [development, non-minified] 0.0% (1/478), failed. error: bundling failed: UnableToResolveError: Unable to resolve module react-native-torch from /Users/ajuvignesh/own/Flashlight/src/App.js: Module does not exist in the module map or in these directories: /Users/ajuvignesh/own/Flashlight/node_modules" Cleaned and reinstalled node_modules but no joy.

zygama commented 6 years ago

Hi, i have the same problem with 1.1.0

dac09 commented 6 years ago

Hello, I'll push up a fix for the 'unable to resolve module' issue for 1.1.0 in a couple of hours.

I think it's something to do with the platform specific extensions, which don't seem to be supported inside a node module.

I have it running locally i.e. not installed through node_modules but cloned into a libs folder and it works ok.

dac09 commented 6 years ago

Created a PR for it (it's a little hard to test without it being published), but think it should solve the problem. Please let me know when you have had a chance to try!

ludo commented 6 years ago

I've published v1.1.1 to npm (npm install react-native-torch@next). It fixes the 'unable to resolve' issue for me.

@dac09 thanks for your contribution/help!

zygama commented 6 years ago

it works now thank you :)