Module 'flutter_barcode_scanner' not found [Flutter / iOS] - ios

I am trying to run a Flutter app on iOS device after some time but the project is failing to build for iOS.
The error that I am getting is happening in the "GeneratedPluginRegistrant.h" file and is as follows:
#import "GeneratedPluginRegistrant.h"
#if __has_include(<flutter_barcode_scanner/SwiftFlutterBarcodeScannerPlugin.h>)
#import <flutter_barcode_scanner/SwiftFlutterBarcodeScannerPlugin.h>
#else
#import flutter_barcode_scanner; /* ERROR: Module 'flutter_barcode_scanner' not found */
#endif
My pubspec.yaml content are as follows:
name: test_app
description: A new Flutter project.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.17.6 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_speed_dial: ^6.2.0
flutter_barcode_scanner: ^2.0.0
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/playstore_icon.png"
min_sdk_android: 29
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.10.0
flutter_lints: ^2.0.0
flutter:
uses-material-design: true
assets:
- assets/
- assets/illustrations/
There is no issue with my Flutter as outputted by flutter doctor command as follows:
[✓] Flutter (Channel stable, 3.3.8, on macOS 12.6 21G115 darwin-arm, locale
en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.74.3)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
• No issues found!
To resolve the issue I tried the following commands first:
flutter clean
flutter pub get
But the issue still persisted. Then I used the following steps to resolve the issue:
Step 1: Deleted the iOS folder in the project.
Step 2: Used the commands in terminal as follows -
flutter create -i swift .
flutter clean
flutter pub get
The issue still persisted and the build failed with the same error as above.
Not quite sure now how to resolve this. Can anyone please help?
Thanks in advance!

Related

Parse Issue (Xcode): Module 'url_launcher_ios' not found

i'm trying to using package: url_launcher of flutter to make call.
my project working til well and when i install url_launcher i got error like this
Parse Issue (Xcode): Module 'url_launcher_ios' not found
my flutter doctor fine
[✓] Flutter (Channel stable, 3.3.10, on macOS 13.1 22C65 darwin-arm, locale en-VN)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] IntelliJ IDEA Community Edition (version 2022.1)
[✓] VS Code (version 1.65.2)
[✓] Connected device (4 available)
[✓] HTTP Host Availability
• No issues found!
some way i also try
flutter clean & flutter pub get
pod update repo && pod install
Try this:
Close Xcode
Check if your minimum deployed version in the pod file is not commented
Check if the package scheme is added in the info.plist file, here.
<key>LSApplicationQueriesSchemes</key> <array> <string>sms</string> <string>tel</string> </array>
Use the lastest version of the package (which is 6.1.7) (as of the date of this answer).
Do and run the following
Delete the pubspec.lock file in the project app directory.
flutter clean
flutter pub get
In the ios directory, run
pod install & pod install --repo-update

iOS app icon not showing up using flutter

I have tried so many ways and fixes but my app icon still not showing up. I'm using flutter and I used the flutter_launcher_icons package but still no use.
Here's my pubspec.yaml dev_depend:
dev_dependencies:
flutter_launcher_icons: "^0.7.3"
flutter_test:
sdk: flutter
and here the config:
flutter_icons:
android: "launcher_icon"
ios: "AppIcon"
image_path_ios: "assets/icon/icon.png"
image_path: "assets/icon/icon.png"
and here's my AppIcon file
This is my flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.20.0-1.0.pre.118, on Mac OS X 10.15.5 19F101, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Android Studio (version 4.0)
[!] IntelliJ IDEA Community Edition (version 2018.2.5)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
This is my Asset Catalog App Icon looks like:
Thanks to #SamiHaddad, I missed setting the AppIcon to Asset Catalog App Icon Set Name in the general section of the Runner file in Xcode. This fixed my issue.
It is worked for me in iOS through manual changes when dependency not worked:-
I have generated app icon which required in manual icon changes through site
(appicon.co)
There I got zip file of Image in which I found a folder Assets.xcassets
after extracting the zip file
I found Appicon.appiconset inside the folder Assets.xcassets
I replaced that Appicon.appiconset folder to
iOS/runner/Assets.xcassets/Appicon.appiconset folder
Flutter pub get
Flutter Run

Flutter: AVCapturePhotoOutput' is only available on iOS 10.0 or newer

Since I upgrade Flutter on the stable channel, I can't run on IOS simulators. This is an error that often appears when updating Flutter, only and despite my research I can't find any solutions. I tried to remove Podfile.lock, update pod and reinstall, change channel and upgrade but always the same error.
Flutter doctor:
[✓] Flutter (Channel stable, v1.17.0, on Mac OS X 10.15.3 19D76, locale en-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.45.0)
[✓] Connected device (3 available)
• No issues found!
Beginning of log:
Xcode build done. 12.3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET gRPC-Core OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/flo/.pub-cache/hosted/pub.dartlang.org/camera-0.4.3+2/ios/Classes/CameraPlugin.m:62:2
4: warning: 'AVCapturePhotoOutput' is only available on iOS 10.0 or newer
[-Wunguarded-availability]
- (void)captureOutput:(AVCapturePhotoOutput *)output
^
In module 'AVFoundation' imported from
/Users/flo/.pub-cache/hosted/pub.dartlang.org/camera-0.4.3+2/ios/Classes/CameraPlugin.m:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureP
hotoOutput.h:48:12: note: 'AVCapturePhotoOutput' has been marked as being introduced in iOS
10.0 here, but the deployment target is iOS 8.0.0
#interface AVCapturePhotoOutput : AVCaptureOutput
I share the solution that works for those who need it:
rm -rf ios/Podfile ios/Podfile.lock ios/Pods ios/Runner.xcworkspace

Flutter shows black screen when launching iOS app

The problem: I get a black screen in my iOS Flutter app after a proper
build (XCode or VSCode or Android Studio), without errors. As soon as
it installs and launches the screen goes to black, with no other sign of life.
The app is generated (I can see the icon on the screen), but as soon I
start the app, it goes completely black.
Setup: (See Flutter doctor below) I´m using Flutter with Firebase
Database in iOS physical device (also in various Simulator types).
Important: The same code for Android is working properly, no black
screen, everything works fine!
I'm pretty sure everything is properly configured in my Firebase
project, I've been checking every detail and, as I say, when
launching to an Android device, everything works fine. For iOS the
file GoogleService-Info.plist is in its place. The configuration of the Signing in XCode also done, and no errors there.
Outputs.-
Flutter doctor -v
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2
19C57, locale es-ES)
• Flutter version 1.12.13+hotfix.5 at /Users/desarrollo/development/flutter
• Framework revision 27321ebbad (2 weeks ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/desarrollo/Library/Android/sdk
• Android NDK location not configured (optional; useful for native
profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3, Build version 11C29
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.41.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.7.1
[✓] Connected device (1 available)
• iPhone 11 Pro Max • C9503E12-9146-452B-93AE-E31DBEA1097E • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
• No issues found!
pubspec.yaml (assume correct tabulations):
name: tumeteo_app
description: A new Flutter project.
version: 1.0.0+1
environment:
sdk: ">=2.2.2 <3.0.0"
dependencies:
flutter:
sdk: flutter
firebase_core: ^0.4.3+1
firebase_storage: ^3.1.0
firebase_storage_image: ^0.4.0
cloud_firestore: ^0.13.0+1
firebase_auth: ^0.15.3
curved_navigation_bar: ^0.3.1
carousel_pro: ^1.0.0
firebase_messaging: ^6.0.9
rflutter_alert: ^1.0.3
shared_preferences: ^0.5.6
image_cropper: ^1.1.0
image_picker: ^0.6.2+1
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.7.4
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon3.png"
adaptative_icon_background: "assets/icon/icon3.png"
flutter:
uses-material-design: true
assets:
- assets/images/
fonts:
- family: PermanentMarker
fonts:
- asset: fonts/PermanentMarker-Regular.ttf
- family: BarlowCondensed
fonts:
- asset: fonts/BarlowCondensed-Regular.ttf
- family: Handlee
fonts:
- asset: fonts/Handlee-Regular.ttf
- family: PathwayGothicOne
fonts:
- asset: fonts/PathwayGothicOne-Regular.ttf
- family: RopaSans
fonts:
- asset: fonts/RopaSans-Regular.ttf
Output from XCode Building:
2019-12-27 11:02:51.658802+0100 Runner[11289:50522] -
<AppMeasurement>[I-ACS036002] Analytics screen reporting is enabled.
Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen
name or override the default screen class name. To disable screen
reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean)
in the Info.plist
2019-12-27 11:02:51.981673+0100 Runner[11289:49976]
[VERBOSE-1:callback_cache.cc(132)] Could not parse callback cache,
aborting restore
2019-12-27 11:02:51.984084+0100 Runner[11289:49976] Configuring the
default Firebase app...
2019-12-27 11:02:51.997756+0100 Runner[11289:50520] 6.14.0 -
[Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not
exist.
2019-12-27 11:02:52.088688+0100 Runner[11289:50521] 6.14.0 -
[Firebase/Analytics][I-ACS023007] Analytics v.60107000 started
2019-12-27 11:02:52.089771+0100 Runner[11289:50521] 6.14.0 -
[Firebase/Analytics][I-ACS023008] To enable debug logging set the
following application argument: -FIRAnalyticsDebugEnabled
2019-12-27 11:02:52.111059+0100 Runner[11289:49976] Configured the
default Firebase app __FIRAPP_DEFAULT.
2019-12-27 11:02:52.226945+0100 Runner[11289:50556] 6.14.0 -
[Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications
proxy enabled, will swizzle remote notification receiver handlers. If
you'd prefer to manually integrate Firebase Messaging, add
"FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to
NO. Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
OUTPUT from VSCode:
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Xcode build done. 570,6s
path: satisfied (Path is satisfied), interface: en0
[VERBOSE-1:callback_cache.cc(132)] Could not parse callback cache,
aborting restore
Configuring the default Firebase app...
path: satisfied (Path is satisfied), interface: en0
Configured the default Firebase app __FIRAPP_DEFAULT.
path: satisfied (Path is satisfied), interface: en0
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
There's a message thrown from the app App with name __FIRAPP_DEFAULT does not exist. - this error commonly appears when Firebase isn't initialized correctly in the Flutter app. Import the packages in the Flutter app's main.dart and initialize Firebase
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';
...
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
You can follow this guide for more details.

Pub can't retrieve any Dart packages

No matter which dart package I am trying to fetch, pub fails retrieving it.
When in my project root folder, I run:
flutter packages get
I consistently get:
Got socket error trying to find package cupertino_icons at https://pub.dartlang.org.
pub get failed (69) -- attempting retry 1 in 1 second...
Here is the output from flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (on Mac OS X 10.13.3 17D47, locale en-US, channel beta)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
[✓] Android Studio (version 3.0)
[✓] IntelliJ IDEA Community Edition (version 2017.3.5)
[!] VS Code (version 1.21.1)
[!] Connected devices
! No devices available
! Doctor found issues in 2 categories.
and the pubspec is what comes with IntelliJ Flutter's wizard:
name: my_friendchat
description: A new Flutter project.
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: "0.1.1"
Any idea how to fix pub?
So... restarting my laptop just fixed it. 😕

Resources