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

[Android] Missing fingerprint image #175

Open
Aidurber opened this issue Nov 9, 2018 · 11 comments
Open

[Android] Missing fingerprint image #175

Aidurber opened this issue Nov 9, 2018 · 11 comments

Comments

@Aidurber
Copy link
Contributor

Aidurber commented Nov 9, 2018

Hello,

The fingerprint image isn't loaded on Android, I believe it was added in #163, see below.

I've double checked everything in the README and I can't see that I've missed anything.
This is the configuration I'm using:

    const optionalConfigObject = {
      title: 'Authentication Required', // Android
      imageColor: '#0000ff',
      sensorErrorDescription: 'Failed', // Android
      cancelText: 'Cancel', // Android
      unifiedErrors: false, // use unified error messages (default false)
      passcodeFallback: false // iOS
    };

build.gradle

    buildToolsVersion = "27.0.3"
    minSdkVersion = 21
    compileSdkVersion = 26
    targetSdkVersion = 27
    supportLibVersion = "27.1.1"

Thoughts?

See below

screenshot_20181109-084308

@Aidurber
Copy link
Contributor Author

I tried playing around with the Porter-Duff modes on the color filter with varying degrees of success, I could never get it to look like the screenshots in #163

@didrikkvanvik
Copy link

It's because of the following line in your code: imageColor: '#0000ff',. That's the default image color value, so you override with the blue color, instead of using the fingerprint image.
Try changing the imageColor value to something like rgba(245, 245, 245, 0).

@Aidurber
Copy link
Contributor Author

@didrikkvanvik I don't believe that's how it's supposed to work, judging from the screenshots in #163.

The result with your approach is:
screenshot 2018-11-20 08 05 08

@srulfi Is that correct?

@didrikkvanvik
Copy link

I experience the same issue, where i'm not able to display the fingerprint image as displayed in #163.

If the config object has no imageColor defined, it will by default render a blue color, which is weird. Setting imageColor to transparent then again produces the following image:

pic

Do you have any idea's as to why this is happening @zibs?

@zibs
Copy link
Collaborator

zibs commented Nov 26, 2018

@srulfi

@srulfi
Copy link
Contributor

srulfi commented Nov 27, 2018

@Aidurber @didrikkvanvik hey guys, sorry for the delayed feedback, I totally missed the first tag from last week.

I have to say this issue you describe is quite odd. First off, I can't reproduce it. I'm using the library on an ongoing project, had pretty much the same build.gradle configuration listed above and just in case updated the values to match it but I'm still seeing the blue fingerprint png (since I'm not overriding the default color in the config object).
Now, despite the fact that the changes done in the PR were not related to the default fingerprint image and default coloring -another way of saying that I think the issue would have arisen anyway-, I can notice that the image you are sharing is not the one we see in the repository (you can tell by the circular background and the fingerprint shadow). That image stayed unmodified from the first time it was uploaded and the same goes to its reference in the fingerprint xml.

So, if both image and reference did not change how come you get a different image? This is the odd part of the issue but from what I can figure it is essentially the issue. You get a blue plain circle because the image the library seems to be manipulating is not the simple .png anymore but this other one.

Another thing to note is that you can see this image as the default one in many devices (had to google it), probably linked to the latest biometrics API/OS version. So, taking this into account I'm wondering if the system is somehow getting in the way, although I really don't see how.

The first thing I would do is double check both image and xml reference you have in your local repo, and I think sharing device and android version info would help too. I tested this on my simulator on the following devices: Nexus 5X and Pixel 2, both Android 9 API 28.

@balthazar
Copy link

I experience the same issue, it was fine previously but recently it started behaving this way, the touch-id version hasn't changed, and I have to set both imageColor and imageErrorColor to transparent in order to make it work. I recently updated to RN 0.57.5, I'll see if that's the issue somehow

@dimlksin2
Copy link

Also faced with this problem

@dimlksin2
Copy link

dimlksin2 commented Jan 29, 2019

Проблемы была решена следующей командой

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

@dimlksin2
Copy link

dimlksin2 commented Jan 29, 2019

The problem was solved by the following command.

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

@albancreton
Copy link

albancreton commented May 29, 2019

Hi there.
I Had the same problem today and realized that if I rename ic_fp_40px.png to fp_40px.png it work fine.
I opened a PR with the very simple and quick fix
#224
@Aidurber @srulfi @zibs

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

7 participants