BlinkID / blinkid-android

Everything you need to add AI-driven ID scanning into your native Android app.
https://microblink.com/identity/identity-document-scanning/
438 stars 153 forks source link

Installation fails on Android SDK 31 #260

Closed mircea-yoti closed 2 years ago

mircea-yoti commented 2 years ago

Description

After updating the Android compile and target SDK versions of our app to 31, installation fails with the following error:

_Installation failed due to: 'Failed to commit install session 1785225438 with command cmd package install-commit 1785225438. Error: -127: Package {our.package} attempting to declare permission android.permission.FLASHLIGHT in non-existing group android.permission-group.HARDWARECONTROLS' Retry

Our app does not explicitly use this permission and associated group. After taking a look at the manifest merger debug report log, I’ve found the following:

uses-permission#android.permission.FLASHLIGHT ADDED from [com.microblink:blinkid:5.14.0] /Users/{user}/.gradle/caches/transforms-2/files-2.1/070e839b49b0733e28d96fd1ad5b54bd/jetified-blinkid-5.14.0/AndroidManifest.xml:19:5-69

BlinkID version: v5.14.0

Device model: Google Pixel 4 emulator

Device Android version: Android 12

anjapenic commented 2 years ago

Hello @mircea-yoti,

Thanks for reaching out with the details. We've forwarded this to the dev team and will let you know when we get more info on the fix. In the meantime, you can revert the compile version to 30 and try setting the target version to 31.

Best regards, Anja

mircea-yoti commented 2 years ago

Thank you, @anjapenic !

anjapenic commented 2 years ago

Hi @mircea-yoti,

We've tried reproducing the issue with our sample app and set the compileSdkVersion and targetSdkVersion to 31 and had no issues with building on a Pixel 4 emulator and Android 12. Could you please prepare a minimal sample where we could reproduce the issue and send it to us at support@microblink.com?

Thanks!

Best regards, Anja

mircea-yoti commented 2 years ago

Hello @anjapenic,

Sorry for the delay, I've looked into this some more. Turns out, another one of our library dependencies was also using the same permission with the group _android.permission-group.HARDWARECONTROLS explicitly declared, and this was the root cause after all.

I'm new to the codebase, so I apologise for the false alarm. Thanks!

All the best, Mircea