mjwheatley / cordova-plugin-android-fingerprint-auth

A cordova plugin for fingerprint authentication using the hardware fingerprint scanner on devices running Android 6+
Apache License 2.0
168 stars 131 forks source link

android.content.res.Resources$NotFoundException only in Release version #87

Closed mabdelwahab closed 7 years ago

mabdelwahab commented 7 years ago

Hello,

First, I would like to thank you for your effort in this amazing plugin, it really helped me a lot. Keep it up 👍

Unfortunately, I'm facing the following issue when I'm using the encrypt function from a signed APK (release) :

android.content.res.Resources$NotFoundException: Resource ID #0x0 at android.content.res.Resources.getValue(Resources.java:1369) at android.content.res.MiuiResources.getValue(MiuiResources.java:145) at android.content.res.Resources.loadXmlResourceParser(Resources.java:2824) at android.content.res.Resources.getLayout(Resources.java:1183) at android.view.LayoutInflater.inflate(LayoutInflater.java:425) at o.ᵔ.onCreateView(:85) at android.app.Fragment.performCreateView(Fragment.java:2220) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:973) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148) at android.app.BackStackRecord.run(BackStackRecord.java:799) at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1537) at android.app.FragmentManagerImpl$1.run(FragmentManager.java:482) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5438) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)

I tested it on two devices : a Xiaomi device and a Samsung device and it happened on both of them. I updated the plugin to the latest version (1.3.1) from version (1.2.7) and still the problem exists.

Can you please help ?

mabdelwahab commented 7 years ago

@mjwheatley a gentle reminder , I'm sorry but please try to support as soon as possible because it is critical at our company.

mjwheatley commented 7 years ago

I do not see anything related to the plugin in your stack trace.

android.content.res.MiuiResources.getValue(MiuiResources.java:145) at

MiuiResources.java is not part of the plugin.

Can you tell what resource value is being requested? What have you tried so far? Have you uninstalled and reinstalled the plugin? Can you replicate the issue in a bare bones project?

mabdelwahab commented 7 years ago

The issue occurs exactly when calling the "encrypt" function, the app crashes. I tried it on a Xiaomi Redmi Note 4 device and Samsung Galaxy A7 2017 device, and both crashed. I could copy the log resulted in the Xiaomi device only.

I tried uninstalling and reinstalling the plugin using the latest version, but same issue occurred.

mjwheatley commented 7 years ago

Can you verify if all of the plugin resources have been been copied to the appropriate directories?

mabdelwahab commented 7 years ago

I figured out the problem !

The issue was not from the plugin itself, it is resulted from code obfuscation library called DexGuard. There are some configuration options that needs to be added in order to use the "resources" of the project correctly in the app.

Thanks for your help, closing the task ...