I start a new project in ionic. Only install the qrscenner plugin. After run command ionic cap build android
run success. Then i run app in Android Studio, get error:
error: cannot find symbol
import android.support.v4.app.ActivityCompat;
^
symbol: class ActivityCompat
I installed floatinghotpot / cordova-plugin-android-support-v4 plugin, but same.
This can be fixed by running:
npm install jetifier
npx jetify
npx cap sync android
... which changed the import reference from:
import android.support.v4.app.ActivityCompat;
to:
import androidx.core.app.ActivityCompat;
Reference: https://forum.ionicframework.com/t/capacitor-cant-build-due-to-androidx-conflicts-at-a-total-loss-on-how-to-fix/185535/16
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With