mobile_scanner icon indicating copy to clipboard operation
mobile_scanner copied to clipboard

iOS: framework not found MLKitBarcodeScanning

Open ralfeus opened this issue 2 years ago • 5 comments

App building for iOS fails with message:

Launching lib/main.dart on iPhone 14 Pro Max in debug mode...
Warning: Missing build name (CFBundleShortVersionString).
Warning: Missing build number (CFBundleVersion).
Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store.
Xcode build done.                                           42.9s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    Writing result bundle at path:
    	...
    ld: framework not found MLKitBarcodeScanning
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Building targets in dependency order
    warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    Result bundle written to path:
    	/var/folders/pm/3br6v2vn7gl77cksjj93hhgm0000gn/T/flutter_tools.bWSwEW/flutter_ios_build_temp_dir3uYSDm/temporary_xcresult_bundle
Error (Xcode): Framework not found MLKitBarcodeScanning

Could not build the application for the simulator.
Error launching application on iPhone 14 Pro Max.
Exited

ralfeus avatar Oct 14 '22 13:10 ralfeus

You can try 2 things here to potentially fix the issue.

First would be to run pod update at the root of the iOS folder, and see if that would fix it.

Second would be to delete the Podfile.lock file from the root of the iOS folder, and then running the pod install command again from the root of the iOS folder.

vlazdra avatar Oct 14 '22 13:10 vlazdra

Tried both. The error is same.

ralfeus avatar Oct 14 '22 14:10 ralfeus

Have you maybe tried pod deintegrate and then pod install?

Also, have you tried fixing the issue also in the output? Build name and number?

And you tried running the flutter clean?

vlazdra avatar Oct 14 '22 14:10 vlazdra

Have you maybe tried pod deintegrate and then pod install?

That did help. Thank you

ralfeus avatar Oct 17 '22 06:10 ralfeus

Awesome, glad it helped. 😃

You can then close the ticket. 🙌

vlazdra avatar Oct 17 '22 07:10 vlazdra