2021年4月2日星期五

Biometric prompt crash because of "You need to use a Theme.AppCompat theme"

I am using androidx:biometric androidx.biometric:biometric:1.1.0 We don't use Theme.AppCompat theme, I am using Theme.Material.Light

Getting this crash on API 23 to API 27.

Since Material theme is supported from API 21 and above, and biometric is supported on API 23 and above. Not sure why we need AppCompat theme?

Is there any way to fix this without using AppCompat theme?

java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.      at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:843)      at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:806)      at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:693)      at androidx.appcompat.app.AppCompatDialog.setContentView(AppCompatDialog.java:95)      at androidx.appcompat.app.AlertController.installContent(AlertController.java:232)      at androidx.appcompat.app.AlertDialog.onCreate(AlertDialog.java:279)      at android.app.Dialog.dispatchOnCreate(Dialog.java:394)      at android.app.Dialog.show(Dialog.java:295)      at androidx.fragment.app.DialogFragment.onStart(DialogFragment.java:512)  
https://stackoverflow.com/questions/66926873/biometric-prompt-crash-because-of-you-need-to-use-a-theme-appcompat-theme April 03, 2021 at 09:06AM

没有评论:

发表评论