I have some issues with Flutter dependancies in iOS (Cocoapods) via the pubspec.yaml file. I can duplicate the issues using the Flutter demo default program and copying these dependancies into the pubspec.yaml file.
cupertino_icons: ^0.1.2
http: ^0.12.0+4
fl_chart: ^0.10.0
flutter_spinkit: "^4.1.1"
flutter_fluid_slider: ^1.0.2
date_format: ^1.0.8
amazon_cognito_identity_dart: ^0.0.22
url_launcher: ^6.0.3
shared_preferences: ^0.5.6
barcode_scan: any
firebase_messaging: 6.0.16
device_info: ^0.4.0+4
flutter_secure_storage: 3.3.3
mapbox_gl: ^0.7.0
flutter_phoenix: "^0.1.0"
intl: ^0.16.1
google_mobile_ads: ^0.12.1+1
I also added this (Below) to Podfile:
platform :ios, '9.0'
use_modular_headers!
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
I get these errors:
Xcode's output:
↳
In file included from /Users/XXXXXX/.pub- cache/hosted/pub.dartlang.org/url_launcher-6.0.7/ios/Classes/FLTURLLauncherPlugin.m:7:
/Users/XXXXXX/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.0.7/ios/Classes/FLTURLLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
Flutter (Channel stable, 2.2.2, on Mac OS X 10.15.7 19H2 darwin-x64,
I Futter clean & delete Pod.lock
Been dealing with this for days, any help would be appreciated, thank you
Have look at error: 'Flutter/Flutter.h' file not found when flutter run on iOS
Remove ios/Flutter/Flutter.podspec: rm ios/Flutter/Flutter.podspec
flutter clean
Run your app again.
Related
When ever i run flutter pub get
this error comes.
it says about migration but i have no idea on this
this is my pubspec.yaml file
environment:
sdk: ">=2.14.4 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons:
# FIREBASE Packages Section
firebase_core: ^1.10.0
firebase_auth: ^3.2.0
cloud_firestore: 2.5.4 #
firebase_messaging: ^11.1.0
firebase_storage: ^10.1.0
google_mobile_ads: ^1.0.0
in_app_purchase: 0.5.2
geoflutterfire: ^3.0.1
flutter_svg: ^0.23.0+1
flutter_launcher_icons: ^0.9.2
country_code_picker: ^2.0.2
scoped_model: ^2.0.0-nullsafety.0
image_picker: ^0.8.4+4
image_cropper: ^1.4.1
url_launcher: ^6.0.15
geolocator: ^7.7.1
geocoding: ^2.0.1
shimmer: ^2.0.0
timeago: ^3.1.0
share: ^2.0.4
flutter_cupertino_datetime_picker: ^3.0.0
place_picker:
git:
url: https://github.com/ajbcoder/locationpicker
dev_dependencies:
flutter_test:
sdk: flutter
my current flutter version
Flutter 3.3.10 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 135454af32 (2 weeks ago) • 2022-12-15 07:36:55 -0800
Engine • revision 3316dd8728
Tools • Dart 2.18.6 • DevTools 2.15.0
How can this be fixed to successfully run the app?
It looks like you are trying to open a very old version of the app. The Flutter Android binding is changed a log since the old versions.
I just faced this issue few days ago.
You have to change some lines in AndroidManifest.xml & MainActivity.
Or if you don't have very big native implementation in place you can try deleting the android folder and run flutter create . command to create a fresh android project supporting flutter.
I suggest making a copy of existing android folder to someplace so if you miss some native implementation you can get if from there.
For manual changes there are mainly three things to change.
Change name tag in AndroidManifest.xml to following
android:name="${applicationName}"
Add this code inside the <application></application> like this.
<application
// application props
>
// other items
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</appplication>
Change you MainActivity file. If its in kotlin you can use this
package <your.package.name>'
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
There is also some steps to migrate to AndroidX on the url which is visible in your console output image. But if you recreating the android folder then this won't be required.
Keep in mind that your packages in pubspec.yaml also very old & you have to change those packages and code supporting new versions of those packages. For example Firebase integration now needs Firebase CLI to be installed on the system. I tried to implement Firebase with older way but its not supported any more.
I have this dependency conflict:
$ flutter pub upgrade --dry-run
Resolving dependencies...
Because image >=2.1.14 <3.0.0-nullsafety.0 depends on archive ^2.0.0 and image >=2.0.4 <2.1.14 depends on archive >=1.0.16 <3.0.0, image >=2.0.4 <3.0.0-nullsafety.0 requires archive >=1.0.16 <3.0.0.
And because flutter_launcher_icons >=0.7.1 <0.9.0 depends on image ^2.1.1 and every version of flutter_driver from sdk depends on archive 3.1.2, flutter_launcher_icons >=0.7.1 <0.9.0 is incompatible with flutter_driver from sdk.
So, because gallery depends on both flutter_driver any from sdk and flutter_launcher_icons ^0.8.1, version solving failed.
pub finished with exit code 1
Versions
$ dart --version
Dart SDK version: 2.13.0-222.0.dev (dev) (Fri Apr 9 12:15:17 2021 -0700) on "macos_x64"
$ flutter --version
Flutter 2.1.0-13.0.pre.574 • channel master • https://github.com/flutter/flutter
Framework • revision 02efffc134 (2 days ago) • 2021-04-10 03:49:01 -0400
Engine • revision 8863afff16
Tools • Dart 2.13.0 (build 2.13.0-222.0.dev)
pubspec.yaml
name: gallery
description: A resource to help developers evaluate and use Flutter.
repository: https://github.com/flutter/gallery
version: 2.8.1+020801
environment:
sdk: ">=2.6.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ">=0.16.1 <=0.17.0"
flutter_localized_locales: ">=1.1.1 <=2.0.0"
cupertino_icons: ^1.0.0
rally_assets: ^2.0.0
meta: ^1.1.8
scoped_model: ^1.1.0
shrine_images: ^1.1.2
url_launcher: ^5.6.0
vector_math: ^2.0.8
collection: ^1.14.0
flutter_gallery_assets: ^0.2.6
package_info: ^0.4.0
google_fonts: ^1.1.2
flutter_staggered_grid_view: ^0.3.3
animations: ^1.1.2
provider: ^4.3.2
adaptive_breakpoints: ^0.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
test:
path:
args:
grinder: ^0.8.0
pedantic: ^1.9.0
string_scanner: ^1.0.5
web_benchmarks: ^0.0.3
flutter_launcher_icons: "^0.8.1"
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/images/logo/roof.png"
flutter:
assets:
- packages/flutter_gallery_assets/assets/studies/shrine_card_dark.png
- ...
...
Tried
I changed:
flutter_launcher_icons: "^0.8.1"
to:
flutter_launcher_icons: "^0.9.0"
But it couldn't help.
Question
I cannot figure out how to resolve the conflict. Is there a standard way for such conflict resolutions which I might be missing?
you can run in your project terminal
flutter pub upgrade --major-versions
Because your project depends on flutter_launcher_icons and flutter_driver
and both packages depend on the third package archive with different versions.
flutter_launcher_icons: "^0.8.1" depends on archive: ">=2.0.4 <3.0.0-nullsafety.0" and flutter_driver from sdk depends on archive: 3.1.2, So there is conflict of resolving version of archive package.
So to resolve this conflict you have to add the manual entry in pubspec.yaml file of your project.
dependency_overrides:
archive: 3.1.2 //any version you want for resolution.
And to know how to flutter resolves dependencies, check the below link.
https://medium.com/cashify-engineering/flutter-dependencies-resolution-2faecdbfce03
this link also describes a standard way of resolving such dependency conflict.
I recently updated the Flutter version from my previous version to 2.0, but with few exceptions occurring I decided to downgrade back to where my flutter version was(1.22.6) on stable channel.
now I get this error on pub get
Because every version of flutter_test from sdk depends on path 1.8.0-nullsafety.1 and PawFect depends on path ^1.8.0, flutter_test from sdk is forbidden.
So, because PawFect depends on flutter_test any from sdk, version solving failed.
pub get failed (1; So, because PawFect depends on flutter_test any from sdk, version solving failed.)
my pubspec.yaml looks like this now.
...
version: 1.0.25+7
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
#Firebase Core API
firebase_core: ^0.7.0
#firebase analytics
firebase_analytics: ^7.0.1
#firebase crashlytics
firebase_crashlytics: ^0.4.0+1
#firebase performance
firebase_performance: ^0.5.0+1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
shared_preferences: ^0.5.12+4
shimmer: ^1.1.2
lite_rolling_switch: ^0.1.1
intl: ^0.17.0
# country_code_picker: ^1.7.0
image_picker: ^0.6.7+21
connectivity: ^3.0.3
# flutter_spinkit: ^4.1.2+1
# gallery_saver: ^2.0.1
# camera: ^0.5.8+5
path: ^1.8.0
http: ^0.12.2
toggle_switch: ^0.1.8
pie_chart: ^5.0.0
fl_chart: ^0.20.1
percent_indicator: ^2.1.9
simple_animations: ^2.4.2
package_info: ^0.4.3+2
# dio: ^3.0.10
sqflite: ^2.0.0+3
path_provider: ^1.6.27
get_it: ^6.0.0
progress_dialog: ^1.2.4
mime: ^0.9.7
http_parser: ^3.1.4
flutter_image_compress: ^0.7.0
flutter_launcher_icons: ^0.9.0
device_preview: ^0.7.1
fluttertoast: ^7.1.6
in_app_purchase: ^0.3.5+1
font_awesome_flutter: ^9.0.0
# rename: ^1.3.0
expansion_tile_card: ^2.0.0
url_launcher: ^6.0.2
provider: ^4.3.2+4
# number_display: ^2.3.0
# functional_widget_annotation: ^0.8.0
# stripe_payment: ^1.0.9
flutter_icons:
# android: "launcher_icon"
image_path: "assets/images/pawfect_logo.png"
# image_path_android: "assets/images/logo_large.png"
# image_path_ios: "assets/images/logo_large.png"
android: true # can specify file name here e.g. "ic_launcher"
ios: true # can specify file name here e.g. "My-Launcher-Icon"
# adaptive_icon_background: "assets/images/christmas-background.png" # only available for Android 8.0 devices and above
# adaptive_icon_foreground: "assets/images/icon-foreground-432x432.png" # only available for Android 8.0 devices and above
dev_dependencies:
flutter_test:
sdk: flutter
..
How can I resolve this error, and get dependencies without an issue.?
flutter doctor
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.6, on Mac OS X 10.15.7 19H114 darwin-x64,
locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
[!] Android Studio (version 4.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Connected device
! No devices available
flutter_test seems to require null safety from at least 1.8.0 to work properly, and the error was thrown when the Flutter version that you're using was downgraded. There's a GitHub ticket filed to document this behavior. The workaround on this issue is to manage the versions that you're using to at least match the minimum dependency set.
I am having this error when I am building my app with Xcode 'module 'cloud_firestore' not found. [enter image description here][1] I have updated my Cocoapods to 1.9.3 and I updated the flutter to 1.17.3, but still is not working and I am opening the file.xcworkspace.
Also, these are the versions of my dependencies:
flutter:
sdk: flutter
flutter_screenutil: ^1.0.2
intl: ^0.16.1
charts_flutter: ^0.8.1
flutter_picker:
git: git://github.com/yangyxd/flutter_picker.git
flutter_cupertino_data_picker: ^0.8.6
firebase_core: ^0.4.3+1
#firebase_analytics: ^5.0.9
firebase_auth: ^0.15.1
provider: ^4.0.4
flutter_spinkit: ^4.1.2
cupertino_icons: ^0.1.2
cloud_firestore: ^0.12.10
firebase_database: ^3.1.3
[1]: https://i.stack.imgur.com/ZPc71.png
from this
For anyone who is facing the problem when “Archiving” or trying to publish to the Apple Store:
Make sure to have all projects closed in Xcode
Open “Runner.xcworkspace” not runner.xcodeproj
You have to make sure that runner.xcodeproj is not open at the same time with workspace.
This is also assuming that you have run and built successfully prior to making an archive.
Update the firestore version:
cloud_firestore: ^0.13.6
my pubspec.yaml
cupertino_icons: ^0.1.3
responsive_container: ^0.0.1
flutter_html: ^0.10.4
http: ^0.12.0+4
flutter_pagewise: ^1.2.3
share: ^0.6.3+6
flutter_youtube: ^1.1.6
loader_search_bar: ^1.0.3+3
firebase_messaging: ^5.1.4
flutter_local_notifications: ^0.8.2
flutter_signin_button: ^1.0.0
url_launcher: ^5.1.2
cloud_firestore: ^0.13.4+2
shared_preferences: ^0.5.6
rate_my_app: ^0.4.0
font_awesome_flutter: ^8.8.1
flutter youtube plugin working good at android same videos
but at ios i get error
[XCDYouTubeKit] Video operation finished with error: The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error -2.)
Domain: XCDYouTubeVideoErrorDomain
Code: -2
User Info: {
}
problem fixed with me by luck
i comment
platform :ios, '10.3'
at Podfile
i was uncomment it
becouse that error
[!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
any way that's working now at ios too
am happy to share it with all