-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
[Biometric] Demo Application Crash BiometricDemoD11 #88
Comments
I'm unable to reproduce this issue on my Pixel 6 Pro (Android 12) or Pixel 3a (Android 11). I don't have an Android 9 device with biometrics to check why it happens on yours |
When you run this function, this problem occurs: function TPlatformBiometric.ShowPrompt: Boolean; And to be even more precise: TJDWBiometricFragmentActivity.JavaClass.start(TAndroidHelper.Context, GetPromptInfoIntent); P.S. Sorry for my English. It's not my native language... |
I have updated the demo with a change that may fix it. You will need to update your Kastri library to obtain all the required changes |
I will be waiting very much. Thank you very much. |
After the update, the error is still the same, only different: Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0 |
Sorry.. I know where the problem is. I just need to work out how to fix it :-) |
I've pushed an update to the biometric R jar (androidx-biometric-1.1.0.R.jar). Can you pull the change, do a Clean of your project and try again? |
Unfortunately, I can't compile. Here's an error: [PAClient Error] Error: E7432 Unable to execute '"C:\Program Files\AdoptOpenJDK\jdk-8.0.242.08-hotspot\bin\java.exe" -jar "c:\program files (x86)\embarcadero\studio\22.0\bin\Android\embt-d8-2.2.64.jar" --intermediate --release --min-api 23 --lib "C:\Users\Public\Documents\Embarcadero\Studio\22.0\CatalogRepository\AndroidSDK-2525-22.0.42600.6491\platforms\android-30\android.jar" --classpath-list "C:\Users\Public\Documents\Embarcadero_Comp\Kastri\Demos\Biometric\Android\Release\classpath-list.txt" --output "C:\Users\Public\Documents\Embarcadero_Comp\Kastri\Demos\Biometric\Android\Release\androidx-activity-1.3.1-dexed.jar" "C:\Users\Public\Documents\Embarcadero_Comp\Kastri\ThirdParty\Android\androidx-activity-1.3.1.jar"' (Error 1) [PAClient Error] Error: E7432 Error in C:\Users\Public\Documents\Embarcadero_Comp\Kastri\ThirdParty\Android\androidx-biometric-1.1.0.R.jar: |
Not sure why it would not be compiling for you - compiles OK here |
I have updated OpenJDK to version 8.0.3.312.7 but the error remains. Maybe you updated some more files, but did not post them? :) |
That's the only file that was changed |
I don't know why, but I rebooted the computer and the project compiled. Now I'll try to run it on different devices. Thanks! |
Error again: java.lang.RuntimeException: Unable to resume activity {com.delphiworlds.BiometricDemoD11/com.delphiworlds.kastri.DWBiometricFragmentActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x7f070000 On the Honor 9 phone, it also crashes (but I can’t see the error on it). |
Can you attach the .APK file, please? |
I may have missed a change to the project file. Please pull the latest changes, and rebuild your project |
Absolutely the same error... :( Maybe try the other way around. Will you send the APK, and I will install it on my phone? |
Here is my APK so you can check if it works on your device |
Your APK also causes the application to the same error... ( |
Without the same (or similar) device to test on, I do not think I can help at the moment |
Is it possible to make it so that when an error occurs, the application does not crash? Something like: |
Unfortunately, no - the crash actually occurs in the Java code for biometrics. Even if I could trap the exception, the code would be useless, as it would not work properly |
What do we do? :) |
Can you try the attached APK? |
Good afternoon. |
OK.. I may have a solution another way, hopefully |
Fine! I will be very hopeful! |
I have just pushed a change to |
Everything is fine! |
Hello! As soon as you disable "Secure File Sharing" everything works. |
In future, please report new issues separately, however: can you check that your AndroidManifest.template.xml file has:
in it? |
Yes, of course, <%provider%> is contained in the AndroidManifest.template.xml file |
Long time issue still unresolved - requires changes to the build process. |
Hello, Delphi Version: 11.1 |
Thanks for the reminder.. I've set another reminder for myself for during this week |
Thank you very much |
Hello, sorry to remind you again. Do you think you'll have some time to work on it ? |
Perhaps tomorrow, if not, the next day :-) |
I would like to be able to provide a solution for this that is easy to incorporate, however it is very complicated. If the Delphi build system was more flexible, it would be easier. The issue is this: As you have discovered, on some devices (I do not know why it is only some), the biometrics expects there to be certain values in the application resources, however in the case of Delphi, they are not compiled in with the application. This Quality Portal report has some background about that: https://quality.embarcadero.com/browse/RSP-20000 In Delphi, currently the build steps for Android are (essentially) like this: Compile/Build steps:
Deploy steps:
In order for the biometrics resources to be included in the application, the steps would need to be like this: Compile/Build steps:
Deploy steps:
It is possible to achieve the same result, however it involves these steps:
Usually, these steps will need to be done only once, however if any changes are made to the project that result in different resource files, steps 1-3 will definitely need to be repeated, and some changes related to step 5 may also need to be considered. I am working on tools that can automate steps 2-3, however I'd much prefer it if Embarcadero could resolve the Quality Portal issue mentioned above |
@Mouscap (and anyone else following) - I have pushed a "beta" demo to the Playground repo, which you are welcome to try, and give feedback on. Please report any such feedback or issues to the Playground issues page. |
These steps only work for 32-bit Android, how to do the same for 64-bit which is the version we posted on Google Play? |
I specifically stated:
You even quoted the same thing in your comment! |
When you press the fingerprint scanner icon, the application crashes and gives the following error:
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/biometric/R$string;
at androidx.biometric.BiometricFragment.authenticate(BiometricFragment.java:381)
at androidx.biometric.BiometricPrompt.authenticateInternal(BiometricPrompt.java:993)
at androidx.biometric.BiometricPrompt.authenticate(BiometricPrompt.java:972)
at com.delphiworlds.kastri.DWBiometricFragmentActivity.authenticate(DWBiometricFragmentActivity.java:91)
at com.delphiworlds.kastri.DWBiometricFragmentActivity.onResume(DWBiometricFragmentActivity.java:106)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1413)
at android.app.Activity.performResume(Activity.java:7400)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3850)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3890)
at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:150)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:73)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1858)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6820)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:922)
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.biometric.R$string" on path: DexPathList[[zip file "/data/app/com.delphiworlds.BiometricDemoD11-alBMpzbi0kV5Eu8m3O07dg==/base.apk"],nativeLibraryDirectories=[/data/app/com.delphiworlds.BiometricDemoD11-alBMpzbi0kV5Eu8m3O07dg==/lib/arm, /data/app/com.delphiworlds.BiometricDemoD11-alBMpzbi0kV5Eu8m3O07dg==/base.apk!/lib/armeabi-v7a, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:171)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 19 more
Delphi Version: 11
Platform(s): Android 9 PPR1.160610.011
Device: Redmi 6, MIUI Global 11.0.5
The text was updated successfully, but these errors were encountered: