If you're using Ionic 4 with Cordova Android 11 (target SDK 34) and struggling with the original phonegap-plugin-barcodescanner
The plugin is outdated or broken on newer Android versions, like mine—here's a working solution using a maintained fork.
Remove the original plugin (if installed):
ionic cordova plugin rm phonegap-plugin-barcodescanner
Install the Android 12-compatible fork:
ionic cordova plugin add https://github.com/Takkuz/phonegap-plugin-barcodescanner-android12
Important: Manually add the missing AAR file if needed (optional)
This fork depends on a native .aar
file that is not bundled, so you must:
Download or copy barcodescanner-release-2.1.5.aar
into:
platforms/android/app/libs/
Downloaded from
Rebuild the project
ionic cordova prepare android
ionic cordova build android
Thank You!!