79681536

Date: 2025-06-27 07:14:48
Score: 1
Natty:
Report link

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.

  1. Remove the original plugin (if installed):

    ionic cordova plugin rm phonegap-plugin-barcodescanner
    
  2. Install the Android 12-compatible fork:

    ionic cordova plugin add https://github.com/Takkuz/phonegap-plugin-barcodescanner-android12

  3. 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

    https://github.com/phonegap/phonegap-plugin-barcodescanner/blob/master/src/android/barcodescanner-release-2.1.5.aar

  4. Rebuild the project

    ionic cordova prepare android

    ionic cordova build android

Thank You!!

Reasons:
  • Blacklisted phrase (0.5): Thank You
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Ashutosh Goyal