ionic capacitor qrscanner activity compat

浪尽此生 提交于 2020-05-27 12:37:30

问题


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 -cannot find symbol class ActivityCompat -cannot find symbol variable ActivityCompat

Ionic version is 6.4.0 and android studio version is 3.6.2

Can some one help me to solve this.


回答1:


Capacitor 2.0 uses Android X, that means all plugins have to use Android X too and that one is not updated.

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


来源:https://stackoverflow.com/questions/61115285/ionic-capacitor-qrscanner-activity-compat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!