I've built my podfile using flutter and the following depreciations are shown for android 12. I tried pod install and pod outdated returns all as up to date. There are no build errors and i can deploy the application successfully but i want to resolve these depreciation warnings and semantic issues as well. All ios deployment targets are set to 12.0. tried flutter clean, pod deintegrate.
pubspec.yaml file packages:
description: A new Flutter project.
https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
webview_flutter: ^3.0.4
flutter_secure_storage: ^5.0.2
shared_preferences: ^2.0.15
intl: 0.17.0
url_launcher: ^6.1.5
http: ^0.13.4
rxdart: ^0.27.5
provider: ^6.0.3
awesome_dialog: ^2.2.1
jwt_decoder: 2.0.1
country_code_picker: 2.0.2
flutter_local_notifications: ^9.7.0
permission_handler: ^10.0.0
firebase_core: ^1.19.2
firebase_messaging: ^12.0.0
shimmer: 2.0.0
flutter_typeahead: ^4.0.0
cached_network_image: ^3.2.1
flutter_html: ^3.0.0-alpha.5
flutter_staggered_animations: 1.0.0
file_picker: ^4.6.1
csv: ^5.0.1
path_provider: ^2.0.11
flutter_rating_bar: ^4.0.1
image_picker: ^0.8.5+3
photo_view: ^0.14.0
flutter_downloader: ^1.8.1
image_downloader: ^0.31.0
flutter_math_fork: ^0.6.3+1
dev_dependencies:
flutter_test:
sdk: flutter
Podfile:
platform :ios, '12.0'
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
Most of these warnings usually come from packages you use in your project. If these are only warnings, ignore them because they are out of your control but if there are errors, either report to package author or fix the error yourself by forking the repository.
In xcode open the xcworkspace file. Then in product select clean build folder.. then on the top area you will see a warning symbol. On clicking that the left panel should show an warnings to upgrade package..click on that and a pop up will appear with option to update. All the other warnings during build can be ignored.
Related
I am using flutter and trying to build an ipa file, I am able to run my app my device or simulator no problem, but can't build an ipa file. I am using the flutter command flutter build ipa and I get this error:
Command PhaseScriptExecution failed with a nonzero exit code
I have tried to do the following:
flutter clean
flutter pub get
cd ios
pod install
pod update
Here is my Podfile:
platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
And here is my pubspec.yaml file:
name: myApp
description: An app for parents built by parents
version: 1.0.0+1
environment:
sdk: ">=2.15.1 <3.0.0"
dependencies:
flutter:
sdk: flutter
firebase_core: 1.12.0
firebase_auth: 3.3.6
cloud_firestore: 3.1.7
firebase_messaging: 11.2.6
firebase_database: 9.0.6
firebase_storage: 10.2.6
shared_preferences: 2.0.12
json_annotation: 4.4.0
uuid: 3.0.5
flutter_easyloading: 3.0.3
flutter_svg: 1.0.3
adaptive_dialog: 1.3.0
image_picker: 0.8.4+5
charts_flutter: 0.12.0
url_launcher: 6.0.12
dart_date: 1.1.1
carousel_slider: 4.0.0
dots_indicator: 2.1.0
open_mail_app: 0.4.4
percent_indicator: 4.0.0
audioplayers: 0.20.1
number_picker_dialog: 0.0.1
share_plus: 3.1.0
flutter_tabler_icons: 1.1.1
flutter_local_notifications: 9.4.0
intl: 0.17.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: 1.0.0
build_runner: 2.1.7
json_serializable: 6.1.4
flutter_icons:
android: "launcher_icon"
ios: true
remove_alpha_ios: true
image_path: "assets/icons/logo.png"
flutter_launcher_name:
name: "MyApp"
flutter:
uses-material-design: true
assets:
- assets/images/intro/
- assets/images/questions/
- assets/images/badges/
- assets/icons/
- assets/data/
- assets/audio/
fonts:
- family: Chalkboard
fonts:
- asset: assets/fonts/chalkboard/Daneehand Demo.otf
- family: Poppins-Light
fonts:
- asset: assets/fonts/poppins/Poppins-Light.ttf
- family: Poppins-Regular
fonts:
- asset: assets/fonts/poppins/Poppins-Regular.ttf
- family: Poppins-Medium
fonts:
- asset: assets/fonts/poppins/Poppins-Medium.ttf
- family: Poppins-SemiBold
fonts:
- asset: assets/fonts/poppins/Poppins-SemiBold.ttf
- family: Poppins-Bold
fonts:
- asset: assets/fonts/poppins/Poppins-Bold.ttf
Can anyone tell me what I am doing wrong?
Update your SDK version from flutter upgrade version 3.0.2 to 3.0.3.
export PATH="your_path/flutter/bin:$PATH"
flutter clean
flutter pub get
cd ios
sudo gem pod install
pod install
run the app from Android Studio IDE so that it checks all the necessary installs.
flutter build ipa --release -t lib/main.dart
Hope it may help you.
You can check the below steps:
Go to iOs Folder and delete podlock file and pods folder
Go to the pod file and edit the below section that contains like as below pic:
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
Go to terminal and cd to iOS folder and run "pod cache clean --all" command
run pod install(pod update) command
Try to Archive again with XCode IDE
First clear Derived data from preference and remove it from bin as well
flutter clean
flutter pub get
cd ios
pod install
pod update
Try this
I was exactly same problem,
Finally I found out after spending two days.
In my case.
Just flutter upgrade version 3.0.2 to 3.0.3
I usually have this problem when a dependency is not updated.
You can try following these steps, this usually works for me:
1- Delete your Podfile.lock (I like to use the command 'rm -rf Podfile.lock' on the terminal for this)
2- Delete your Pods folder (I like to use the command 'rm -rf Pods' in the terminal for this)
3- Delete your .xcworkspace
4- Pod install
5- Clear your project into XCode> Product> Clean Build Folder
This mainly happens because of less space in your machine. Clean up some space, delete derived data and archieves of older builds
Path to derived data
~/Library/Developer/Xcode/DerivedData
Enter this in finder -> go -> go to folder
Yoy can also restart your machine to clean all temp files
Also try building it from xcode directly
I got flutter version updated in my Mac Mini with an Intel Core i5 processor. I also got all dependencies updated and since then, the command flutter build iOS give me the following error message:
Running pod install... 8.5s
Running Xcode build...
Xcode build done. 298.4s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/tg/fczlyhk12rx2w1hmynl87h100000gn/T/flutter_tools.TkBEUj/flutter_ios_bui
ld_temp_dir6kZl5n/temporary_xcresult_bundle
/Users/macmini/development/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handl
er_apple-9.0.3/ios/Classes/strategies/PhonePermissionStrategy.m:50:35: warning:
'subscriberCellularProvider' is deprecated: first deprecated in iOS 12.0
[-Wdeprecated-declarations]
CTCarrier *carrier = [netInfo subscriberCellularProvider];
^~~~~~~~~~~~~~~~~~~~~~~~~~
serviceSubscriberCellularProviders
In module 'CoreTelephony' imported from
/Users/macmini/development/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handl
er_apple-9.0.3/ios/Classes/strategies/PhonePermissionStrategy.m:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
iPhoneOS15.2.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers/CTTelephony
NetworkInfo.h:112:50: note: property 'subscriberCellularProvider' is declared
deprecated here
#property(readonly, retain, nullable) CTCarrier *subscriberCellularProvider
API_DEPRECATED_WITH_REPLACEMENT("serviceSubscriberCellularProviders", ios(4.0, 12.0))
API_UNAVAILABLE(macos);
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
iPhoneOS15.2.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers/CTTelephony
NetworkInfo.h:112:50: note: 'subscriberCellularProvider' has been explicitly marked
deprecated here
1 warning generated.
remark: Incremental compilation has been disabled: it is not compatible with whole
module optimization
/Users/macmini/projects/user/plugins/here_sdk/ios/Classes/MapController.swift:14:8:
warning:
'/Users/macmini/projects/user/build/ios/Release-iphoneos/XCFrameworkIntermediates/here
_sdk/heresdk.framework/Modules/heresdk.swiftmodule/Project/arm64-apple-
...
target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported
deployment target versions is 9.0 to 15.2.99. (in target 'gRPC-C++' from project
'Pods')
Result bundle written to path:
/var/folders/tg/fczlyhk12rx2w1hmynl87h100000gn/T/flutter_tools.TkBEUj/flutter_ios_bui
ld_temp_dir6kZl5n/temporary_xcresult_bundle
Error (Xcode): 'Flutter/Flutter.h' file not found
/Users/macmini/projects/user/ios/Runner/GeneratedPluginRegistrant.h:9:8
Error (Xcode): failed to emit precompiled header
'/Users/macmini/Library/Developer/Xcode/DerivedData/Runner-devstpmlflumiphldfeciqbjcala/Bu
ild/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_38Z840ER98F9S-cl
ang_3O4VCJPZ1F0UQ.pch' for bridging header
'/Users/macmini/projects/user/ios/Runner/Runner-Bridging-Header.h'
Encountered error while building for device.
I've tried all the solutions posted for the 'Flutter/Flutter.h' file not found error, but nothing worked.
I have also tried deleting the Pods folder and installing all from scratch, but it didn't work either.
I uninstalled and reinstalled Xcode and the problem is still the same.
Here I leave my flutter doctor, and information on the configuration of my project in flutter.
$ flutter doctor:
[✓] Flutter (Channel stable, 2.10.3, on macOS 12.2.1 21D62 darwin-x64, locale es-419)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.65.0)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
• No issues found!
pubspec.yaml
name: name
description: description
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# version: 1.0.0+1
version: 7.8.7+7.8.7
environment:
sdk: ">=2.16.1 <3.0.0"
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
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: ^1.0.4
country_code_picker: ^2.0.2
http: ^0.13.4
firebase_auth: ^3.3.10
firebase_core: ^1.13.1
cloud_firestore: ^3.1.10
intl: ^0.17.0
image_picker: ^0.8.4+11
image_cropper: ^1.5.0
firebase_storage: ^10.2.9
sembast: ^3.2.0
flutter_launcher_icons: ^0.9.2
url_launcher: ^6.0.20
connectivity_plus: ^2.2.1
permission_handler: ^9.2.0
notification_permissions: ^0.6.1
bubble: ^1.2.1
pin_code_fields: ^7.3.0
flutter_rating_bar: ^4.0.0
get: ^4.6.1
cached_network_image: ^3.2.0
here_sdk:
path: plugins/here_sdk
location: ^4.3.0
skeletons: ^0.0.3
firebase_messaging: ^11.2.10
badges: ^2.0.2
dev_dependencies:
flutter_test:
sdk: flutter
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^1.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/PLASS.png
- assets/main/PlassLogo.png
- assets/main/Artwork.png
- assets/icons/sideMenu.png
- assets/icons/HandUp.png
- assets/icons/currentLocation.png
- assets/icons/pickup.png
- assets/icons/drop.png
- assets/icons/cars/standar.png
- assets/icons/cars/standar-min.png
- assets/icons/cars/standar-min-ios.png
- assets/icons/by-woman.png
- assets/icons/camera.png
- assets/3d/sedan.obj
- assets/3d/plane.obj
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependenc∫ies,
# see https://flutter.dev/custom-fonts/#from-packages
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/main/icon.png"
adaptive_icon_foreground: "assets/main/foreground-icon.png"
adaptive_icon_background: "#ffffff"
Podfile
# Uncomment this line to define a global platform for your project
platform :ios, '12.4'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
I cannot run or build the iOS app. This always happens with the same error.
I have already repaired Flutter pub caches.
Deleted the pod files.
Removed the iOS folder and tried:
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 28.2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
In file included from /Users/ravindu/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/JavaScriptChannelHandler.m:5:
/Users/ravindu/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/JavaScriptChannelHandler.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/ravindu/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FlutterWebView.m:5:
/Users/ravindu/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FlutterWebView.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/ravindu/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FLTWebViewFlutterPlugin.m:5:
/Users/ravindu/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FLTWebViewFlutterPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/ravindu/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FLTWKProgressionDelegate.m:5:
/Users/ravindu/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FLTWKProgressionDelegate.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/ravindu/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FLTWKNavigationDelegate.m:5:
/Users/ravindu/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FLTWKNavigationDelegate.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from /Users/ravindu/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FLTCookieManager.m:5:
/Users/ravindu/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter_wkwebview-2.7.1/ios/Classes/FLTCookieManager.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
Here is the pod file:
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
# flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 11.0
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
end
end
Here is the Pubspec.yaml file:
name: fstore
publish_to: "none"
description: Mobile commerce app by Flutter
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 2.8.0+1
environment:
sdk: ">=2.15.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
inspireui: 1.0.10
# Base
intl: 0.17.0
crypto: 3.0.1
path_provider: 2.0.8
url_launcher: 6.0.17
localstorage: 4.0.0+1
http: 0.13.4
http_auth: 1.0.1
share: 2.0.4
wakelock: 0.5.6
# FIREBASE PACKAGES
firebase_core: 1.10.5
firebase_analytics: 9.0.2
firebase_auth: 3.3.3
firebase_remote_config: 1.0.2
firebase_dynamic_links: 4.0.2
cloud_firestore: 3.1.4
# STATE MANAGEMENT
provider: 6.0.1
get_it: 7.2.0
# SPLASH SCREEN, ONBOARD
flare_loading: 3.0.0
rive: 0.7.33
# ICON FONTS
cupertino_icons: 1.0.4
# WEB TOOLS
html_unescape: 2.0.0
webview_flutter: 3.0.0
webview_flutter_web: 0.1.0
responsive_builder: 0.4.1
webview_windows: 0.1.0
flutter_inappwebview: 5.3.2
# webview_flutter_wkwebview: ^2.7.1
# HTML render
flutter_widget_from_html_core: 0.8.3
fwfh_text_style: ^2.7.0+1
fwfh_webview: 0.6.2+1
fwfh_svg: 0.7.2
fwfh_cached_network_image: 0.7.0+2
fwfh_url_launcher: 0.6.1+3
fwfh_chewie: 0.7.0+1
# MAP
google_maps_flutter: 2.1.1
location: 4.3.0
maps_launcher: 2.0.1
geocode: 1.0.1
# AUTHENTICATION
the_apple_sign_in: 1.1.1
flutter_facebook_auth: 3.5.7
google_sign_in: 5.2.1
sms_autofill: 2.2.0
# PUSH NOTIFICATION
firebase_messaging: 11.2.3
notification_permissions: 0.6.1
flutter_local_notifications: 9.1.5
onesignal_flutter: 3.2.7
# FILES, IMAGES
file_picker: 4.2.7
cached_network_image: 3.2.0
image: 3.1.0
transparent_image: 2.0.0
image_picker: 0.8.4+4
flutter_native_image: 0.0.6+1
multi_image_picker2: 5.0.2
flutter_cache_manager: 3.3.0
# ADS
google_mobile_ads: 1.0.1
# TOOLS
google_fonts: 2.1.0
random_string: 2.3.1
json_annotation: 4.4.0
timeago: 3.1.0
universal_platform: 1.0.0+1
uuid: 3.0.5
easy_debounce: 2.0.1
devicelocale: 0.5.0
collection: 1.15.0
visibility_detector: 0.2.2
rate_my_app: 1.1.1+1
enum_to_string: ^2.0.1
flutter_linkify: ^5.0.2
gms_check: ^1.0.0
# UI
flutter_spinkit: 5.1.0
smooth_page_indicator: 1.0.0+2
animated_text_kit: 4.2.1
animations: 2.0.2
flash: 2.0.3
flutter_staggered_grid_view: 0.4.1
flutter_swiper_null_safety: 1.0.2
pull_to_refresh: 2.0.0
implicitly_animated_reorderable_list: 0.4.2
rubber: ^1.0.1
pin_code_fields: 7.3.0
country_code_picker: 2.0.2
country_pickers: 2.0.0
intro_slider: ^3.0.2
dropdown_search: 2.0.1
flutter_calendar_carousel: 2.1.0
currency_text_input_formatter: 2.1.5
flutter_zoom_drawer: ^2.1.1
qr_code_scanner: 0.6.1
paytm_allinonesdk: 1.1.4
charts_flutter: ^0.12.0
extended_image:
git: https://github.com/inspireui/extended_image.git
razorpay_flutter:
git: https://github.com/inspireui/razorpay-flutter.git
###---- Some extra feature is disable by default -----###
### ▶️ Audio Feature
### Search "Enable Audio feature" & uncomment to use - https://tppr.me/Z1TX5
# audio_manager: ^0.8.1
### 🌎 Webview Plugin
### Search "Enable webview payment plugin" & uncomment to use - https://tppr.me/wlgV1
# flutter_webview_plugin: 0.4.0
### 💳 Facebook Ads
### Search "Enable Facebook Ads" & uncomment to use - https://tppr.me/9Pkf9
# facebook_audience_network: 1.0.0-nullsafety.0
dev_dependencies:
flutter_lints: 1.0.4
flutter_native_splash: 1.3.2
# convert_data:
# path: _dev/convert_data
## Enable to use Flutter Test Driver
# flutter_driver:
# sdk: flutter
# test: 1.16.5
# dependency_validator: 3.1.0 # pub run dependency_validator
## Enable To run json serializer, run:
## flutter pub run build_runner build --build-filter="lib/models/serializers/*.dart" --delete-conflicting-outputs
## flutter pub run build_runner serve --build-filter="lib/models/serializers/*.dart"
# build_runner: 2.0.3
# json_serializable: 4.1.2
# Run this script to generate the app icon: flutter pub run flutter_launcher_icons:main
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/images/app_icon.png"
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
uses-material-design: true
assets:
- lib/config/
- lib/config/mocks/
- lib/config/states/
- lib/config/stories/
- assets/icons/credit_cards/
- assets/icons/tabs/
- assets/icons/payment/
- assets/icons/logins/
- assets/images/
- assets/images/country/
- assets/images/favicon/
- assets/html/
- google_fonts/
flutter_intl:
enabled: true
use_deferred_loading: true
I have tried different methods and still same issue.
i have the same issue before a thou days and in mycase the solution was to countinue this steps:
Backup Runner folder
Delete the ios folder
Go to a terminal and execute flutter create . in the flutter project folder
Paste your Runner folder back into the ios folder
pod deintegrate in the ios folder
pod install also in the ios folder
flutter clean in the flutter project folder
flutter pub get
flutter run
Please note that if you use firebase you need to re-insert the GoogleService-Info.plist file
Hope it helps!
I get this error every time I try adding Cloud Firestore to my Flutter project. I first tried it with my main project, where it failed. I tried it on a clean new project where I get the same result every single time. I've read at least 10 different posts where someone had this error. None of it has worked. I tried deleting Pods and Podfile/Podfile.lock and generating new ones. I've tried using the newest dependency "cloud_firestore: ^0.14.0".
This is my pubspec.yaml:
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
cloud_firestore: ^0.14.0
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.3
dev_dependencies:
flutter_test:
sdk: flutter
This my Podfile (part of it):
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Runner' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Runner
end
# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
pod 'Firebase/Firestore'
I am getting miserable because I've spent two days watching YouTube videos, checking any article I could and, I kid you not, nothing has worked. I've even contacted Firebase Support to get some answer, but I haven't gotten any response yet.
If you happen to know how I could fix this, I will seriously be so thankful!
Trust me, I search for over 5 hours, tried every solution I can find on internet. And only one work:
Delete the Podfile, Podfile.lock, Pods folder
flutter clean
cd ios
pod deintegrate ( this way pod will not reinstall the old libray )
cd ../
flutter run
Most of the solution don't include step 4, so that why even you clean and reinstall pod, it still behave the same.
At the developer, we can learn how to reverse the binary tree in 2 hour and struggle with install steps for over a day, one of the most annoying thing of being developer.
you are missing firebase_core
dependencies:
flutter:
sdk: flutter
firebase_core: ^0.5.0
cloud_firestore: ^0.14.0+2
check this official guide for more: Cloud Firestore
replace your podfile with this one
ENV['COCOAPODS_DISABLE_STATS'] = 'true' //add this line at the beginning of that file
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
platform :ios, '9.0'
target 'Runner' do
use_frameworks!
use_modular_headers!
pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'Firebase/Analytics'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
flutter clean
flutter run
I have a flutter app that was working fine. I'm going through updating my flutter version and the versions of some of my plugins (on the newest XCode version 11). I can no longer build my app because either one of two things occurs:
1) If I don't have "use_modular_headers!" in my podfile, I get this error when trying to run pod install:
The Swift pod `DKPhotoGallery` depends upon `SDWebImage`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
2) If I add "use_modular_headers!" to the podfile, then I can successfully install the podfiles, but it fail when building with this error:
fatal error: module map file '/Users/mbpro/Documents/Perkl/ios/Pods/Headers/Private/openssl_grpc/BoringSSL-GRPC.modulemap' not found
The second error I've come to find out is because GRPC doesn't support modular headings. This is where I'm stuck, because due to flutter's way of dynamically generating podfile from the pubspec, it seems modular headers are either globally on or off, and I can't specifically turn on modular headers for specific pods.
Here is a list of my pubspec dependencies:
cloud_firestore: 0.13.6
firebase_auth: 0.16.1
firebase_core:
firebase_database:
firebase_storage:
firebase_messaging:
google_sign_in:
image_picker:
image_cropper:
intl:
flutter_sound:
flutter_launcher_icons:
flushbar:
file_picker:
path_provider:
#audioplayers:
provider:
sliding_up_panel:
font_awesome_flutter:
marquee:
Any help on this is going to greatly appreciated!! It's completely shut down my development since I can't build to test anything after upgrading.
Edit: Flutter Doctor -v output (everything looks fine)
[✓] Flutter (Channel stable, v1.17.3, on Mac OS X 10.15.5 19F101, locale en-US)
• Flutter version 1.17.3 at /Users/mbpro/Downloads/flutter
• Framework revision b041144f83 (8 days ago), 2020-06-04 09:26:11 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/mbpro/Library/Android/sdk
• 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.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.9.3
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 44.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (1 available)
• iPhone SE (2nd generation) • 9FC22937-91AB-4F22-BB1E-20FFB1CAF4C8 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
• No issues found!
After a very long search, the answer is easy.
1- navigate to ios directory inside your app
2- edit podfile in text editor
3- search for target 'Runner' do
4- add use_frameworks! in the next line
5- save and run your app
for example, my full podfile looks like this before solving the issue
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
After solving the issue by adding the extra line it looks like
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
I'been struggling all day with the same issue using a very similar plugin list.
Using this answer:
Using static libraries with CocoaPods 1.5 no such module at import
I was able to modify the flutter pod as follows and build the project:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
inhibit_all_warnings! # ------------------> NEW
use_frameworks! # ------------------> NEW
dynamic_frameworks = ['BoringSSL-GRPC'] # ------------------> NEW
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
generated_key_values = {}
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) do |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
generated_key_values[podname] = podpath
else
puts "Invalid plugin specification: #{line}"
end
end
generated_key_values
end
target 'Runner' do
# Flutter Pod
copied_flutter_dir = File.join(__dir__, 'Flutter')
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
unless File.exist?(generated_xcode_build_settings_path)
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
unless File.exist?(copied_framework_path)
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
end
unless File.exist?(copied_podspec_path)
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
end
end
# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'
# Plugin Pods
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.each do |name, path|
symlink = File.join('.symlinks', 'plugins', name)
File.symlink(path, symlink)
pod name, :path => File.join(symlink, 'ios')
end
end
pre_install do |installer| # ------------------> NEW BLOCK
installer.pod_targets.each do |pod|
puts "Evaluating static framework for pod #{pod.name}"
if dynamic_frameworks.include?(pod.name)
puts "Overriding the static_framework method for #{pod.name}"
pod pod.name, :modular_headers => false
end
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
Its my first time building the app in IOS and the total build time is around 35m (!), I don t known if it is related to this fix, or it's something else.
Also tried doing the inverse, all dynamic and the DKPhotoGalley static, but that makes the build fail with errors on the DKPhotoGallery code.
if someone can chime in with a better approach or understanding of the underlying issue would be great.
Figured it out. I reverted file_picker to 1.6.3+2 now I am able to run my iOS app with no problems. Enjoy. Hope you don't use any of the newer features added to file picker after this version. I was lucky enough to where I don't. I believe this breaking change is why. Either way this worked for me hope it works for you.