question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

zxing.HasTorch returns false on Android even phone has a torch

See original GitHub issue

I tried your sample and code below doesn’t display the flash button although my phone has has torch, HasTorch returns always false. If set it true, torch is just working fine on my code. it seems like a bug on android. I tried 3 beta as well. same problem

	overlay = new ZXingDefaultOverlay()
			{
				TopText = "Hold your phone up to the barcode",
				BottomText = "Scanning will happen automatically",
				ShowFlashButton = zxing.HasTorch,
                AutomationId = "zxingDefaultOverlay",
			};

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
thhowlcommented, Oct 16, 2020

@knocte , I will try 3.0 beta next week.

0reactions
LymarVcommented, Mar 4, 2021

I had the same issue and it appeared that I didn’t have the Android FLASHLIGHT permission in the AndroidManifest.xml (silly me).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Turn ON/OFF flashlight in zxing fragment lib
I have used following library: https://code.google.com/p/barcodefraglibv2/ I want to turn ON/OFF the flash light on click of a button when ...
Read more >
ZXing.Net.Mobile
HasTorch delivers false on a real iOS device (iPhone 6s Plus with iOS 9.2).
Read more >
Creating Custom Overlays in Xzing Barcode Scanner using ...
I've recently had need to customize the UI overlay of the excellent and free barcode scanning plugin Zxing. While gathering material for ...
Read more >
mobile_scanner | Flutter Package
A universal barcode and QR code scanner for Flutter based on MLKit. Uses CameraX on Android, AVFoundation on iOS and Apple Vision &...
Read more >
C# (CSharp) ZXingScannerView Examples
C# (CSharp) ZXingScannerView - 33 examples found. ... Add(torch); BUG on library, this returns always FALSE customOverlayBottom.Children.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found