detector.isOperational() always false on android

后端 未结 7 642
遇见更好的自我
遇见更好的自我 2021-01-18 08:26

I\'m using the new google plays service: Barcode detector, for this porposue I\'m following this tutorial : https://search-codelabs.appspot.com/cod

7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-18 09:07

    Here is what was my case. I was using BarcodeDetector for decoding QR codes from imported images. On 4 my testing devices it was working fine. On one was not reading anything from bitmap. I thought this might be incompatibility with android 5.0 but this was not the case. After hours of investigation I finally noticed that detector.isOperational(); returns false. The reason was:

    The first time that an app using barcode and/or face APIs is installed on a device, GMS will download a libraries to the device in order to do barcode and face detection. Usually this is done by the installer before the app is run for the first time.

    I had wi-fi off on that testing device. After turning it on and relaunching app, detector became operational and started decoding bitmaps.

提交回复
热议问题