3

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?

Obed Monsalve
  • 171
  • 2
  • 12

2 Answers2

3

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.

Arnold Veltmann
  • 666
  • 5
  • 5
  • Sorry for the late answer... I changed the deployment target and it didn't work, how can I remove the pubspec.lock file and run flutter clean? In the pre-build script?, I'm a completely noob in this CI stuff. – Obed Monsalve Nov 17 '20 at 23:00
  • If the pubspec.lock file exists, then it's in your repository, and you can just delete it, flutter clean you can run in your pre-build script if you wish, yes. I'd also try to check out Codemagic slack channel to get faster help. – Arnold Veltmann Nov 18 '20 at 09:51
  • 1
    And I think I'm gonna take the slack suggestion, because the problem remains even after all that. – Obed Monsalve Nov 18 '20 at 21:15
0

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.

Akif
  • 7,098
  • 7
  • 27
  • 53
  • Triple checked that, the problem isn't in the dependencies, I'm using the same code that I used in the android version to build the ios version... The problem is in codemagic, somehow, it can't find the module. – Obed Monsalve Nov 12 '20 at 20:50
  • Have you resolved ? I have the same problem. – ZioBudda Mar 04 '21 at 16:35
  • 1
    the same problem happened to me in Xcode, I think it is a problem with compatibility between the ios minimum target and the package – Mohammad Rabiee Nasri Nov 09 '21 at 17:25