How to solve "fatal error: module 'barcode_scan' not found" in codemagic?

Viewed 2987

I created a android app with flutter and android studio and everything is good, it's has been builded, tested and deployed, now I'm trying build an ios version using that same codebase but I don't have a mac... So, I'm using codemagic.io to build the ios app, but when I try to build the app, it throws me this error:

enter image description here

The error is caused for this package, it says that it can't be found, but I don't have a clue of what to do because in the android version that I built in android studio it worked perfectly, I even tried to build an apk in codemagic and it worked too, the problem is specific to ios. Any help?

2 Answers

In many cases this is actually due to version inconsistency. The pub page seems to indicate that the minimum necessary deployment target for barcode_scan is 11.

Thus, I'd recommend trying to check whether you've got your iOS deployment targets and versions set to 11 throughout your project - obvious places to look: project.pbxproj, AppFrameworkInfo.plist and your podfile.

I think it would also be safe to remove your pubspec.lock and podfile.lock files before trying to build, and running flutter clean.

You need to add the package into your pubspec.yaml file.

  dependencies:
    barcode_scan: ^3.0.1

After that, you need to install the package with this command:

  flutter pub get

You can read more from here.

Related