离子电容器 qrscanner 活动兼容 [英] ionic capacitor qrscanner activity compat
问题描述
我正在创建一个离子电容器应用程序.在我的应用程序中,我必须使用 QR 扫描仪,所以我使用了 https://ionicframework.com/docs/native/qr-scanner 插件来集成 qr 扫描器.然后我做 ionic capacity copy android
和 ionic capacity open android
.然后在 android studio 中,当我尝试构建它时抛出
I'm creating an ionic capacitor application. In my app I have to use QR Scanner so I used https://ionicframework.com/docs/native/qr-scanner plugin to integrate qr scanner. Then I do ionic capacitor copy android
and ionic capacitor open android
. Then in android studio when I try to build it throws
capacitor-cordova-android-plugins/src/main/java/com/bitpay/cordova/qrscanner/QRScanner.java-找不到符号类ActivityCompat-找不到符号变量ActivityCompat
capacitor-cordova-android-plugins/src/main/java/com/bitpay/cordova/qrscanner/QRScanner.java -cannot find symbol class ActivityCompat -cannot find symbol variable ActivityCompat
Ionic 版本为 6.4.0,android studio 版本为 3.6.2
Ionic version is 6.4.0 and android studio version is 3.6.2
谁能帮我解决这个问题.
Can some one help me to solve this.
推荐答案
Capacitor 2.0 使用 Android X,这意味着所有插件也必须使用 Android X 并且没有更新.
Capacitor 2.0 uses Android X, that means all plugins have to use Android X too and that one is not updated.
作为变通方法,您可以使用 Capacitor 1.5.2 或使用 jetifier 修补插件以使用 Android X.
As workarounds you can use Capacitor 1.5.2 or use jetifier to patch plugins to use Android X.
npm install jetifier
npx jetifier
npx cap sync android
这篇关于离子电容器 qrscanner 活动兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!