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

Flashlight not working on Android #6

Open
AlexBacich opened this issue Aug 3, 2018 · 6 comments
Open

Flashlight not working on Android #6

AlexBacich opened this issue Aug 3, 2018 · 6 comments

Comments

@AlexBacich
Copy link

Flash isn't working.
Tried to start on example - it gives an error:

E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): Failed to handle method call
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): java.lang.RuntimeException: getParameters failed (empty parameters)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): at android.hardware.Camera.native_getParameters(Native Method)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): at android.hardware.Camera.getParameters(Camera.java:2027)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): at plugins.flutter.lamp.lamp.LampPlugin.turn(LampPlugin.java:63)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): at plugins.flutter.lamp.lamp.LampPlugin.onMethodCall(LampPlugin.java:34)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:191)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:152)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): at android.os.MessageQueue.next(MessageQueue.java:375)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): at android.os.Looper.loop(Looper.java:225)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): at android.app.ActivityThread.main(ActivityThread.java:6589)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(31729): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

@AlexBacich AlexBacich changed the title Flashlight drops an error on Android Flashlight not working on Android Aug 3, 2018
@adlanarifzr
Copy link

Same error happened.

@agreensh
Copy link

agreensh commented Dec 3, 2018

Same error.

E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): Failed to handle method call
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): java.lang.RuntimeException: getParameters failed (empty parameters)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): at android.hardware.Camera.native_getParameters(Native Method)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): at android.hardware.Camera.getParameters(Camera.java:1952)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): at plugins.flutter.lamp.lamp.LampPlugin.turn(LampPlugin.java:63)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): at plugins.flutter.lamp.lamp.LampPlugin.onMethodCall(LampPlugin.java:34)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:200)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:163)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): at android.os.MessageQueue.next(MessageQueue.java:323)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): at android.os.Looper.loop(Looper.java:136)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): at android.app.ActivityThread.main(ActivityThread.java:6682)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
E/MethodChannel#github.com/clovisnicolas/flutter_lamp(14908): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

@markflarup
Copy link

markflarup commented Jan 2, 2019

I have tried to make the example code work on a Nexus 5 running Nougat (7.1.2) without any luck. I have granted my application permissions to use the camera without affecting the outcome. The flash is working as I can toggle it from the dropdown menu.
However, when I run it on a Oneplus5 with Oreo I can make it work. Has anybody else encountered a similar problem?

The only outcome I get in the terminal is the initial check: I/flutter (16233): Device has flash ? true

I have specified version lamp: 0.0.6 as dependency.

@agreensh
Copy link

agreensh commented Jan 2, 2019

I have tried to make the example code work on a Nexus 5 running Nougat (7.1.2) without any luck. I have granted my application permissions to use the camera without affecting the outcome. The flash is working as I can toggle it from the dropdown menu.
However, when I run it on a Oneplus5 with Oreo I can make it work. Has anybody else encountered a similar problem?

The only outcome I get in the terminal is the initial check: I/flutter (16233): Device has flash ? true

I have specified version lamp: 0.0.6 as dependency.

If you need a solution now, look at Issue #7 and follow use of torch.zip plugin.

@markflarup
Copy link

If you need a solution now, look at Issue #7 and follow use of torch.zip plugin.

I tried to make it work without any luck. I will try to document my steps to figure out where I went wrong. Thanks for the reply.

Just a thought: have you considered closing this issue?

@agreensh
Copy link

agreensh commented Jan 3, 2019

I haven't closed this issue as, even though I've worked around it, it is still an issue with this package (flutter_lamp).

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

4 participants