Flutter Podfile not created correctly - ios

I created a new flutter project. This is my pubspec.yaml file:
name: app_name
description: App Name
version: 1.0.0+1
environment:
sdk: ">=2.16.1 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_bloc: ^7.3.1
flutter_localizations:
sdk: flutter
get_it: ^7.1.3
floor: ^1.2.0
flutter_speed_dial: ^5.0.0+1
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
flutter_launcher_icons: ^0.9.2
floor_generator: ^1.2.0
build_runner: ^2.1.2
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/logo.png"
flutter:
uses-material-design: true
module:
androidX: true
androidPackage: com.example.appname
iosBundleIdentifier: com.example.appname
When I run the following commands:
flutter pub get
pod init
pod install
The podfile is created, but only with the following contents:
# 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
When I try to run the app, I get the following error:
The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation
Anyone knows how I can fix this?

First clear Derived data from preference and remove it from bin as well
then use following commands
flutter clean
flutter pub get
cd ios
pod install
pod update

Related

flutter build ipa - Command PhaseScriptExecution failed with a nonzero exit code

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

Unable to run flutter. Throws "couldn't find package fluttery:" error

This is the error
description: A new Flutter project.
version: 0.9.91+50
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
SDK: flutter
cupertino_icons: ^0.1.2
audioplayers: ^0.11.0
agora_rtc_engine: ^0.9.4
cached_network_image: ^0.7.0
country_pickers: ^1.0.1
dio: ^2.0.22
flutter_launcher_icons: ^0.7.0
flutter_rating: ^0.0.2
fluttery: ^0.0.8
font_awesome_flutter: ^8.4.0
get_it: ^1.0.3
google_sign_in: ^4.0.1+3
image_picker: ^0.5.0+3
intl: ^0.15.7
intro_views_flutter: ^2.4.0
permission_handler: ^3.0.0
photo_view: ^0.2.1
razorpay_plugin: ^0.2.9
rxdart: ^0.21.0
shared_preferences: ^0.5.1+1
side_header_list_view: ^0.0.4
strings: ^0.1.0
url_launcher: ^5.0.2
path_provider: ^0.5.0+1
screen: ^0.0.5
flutter_typeahead: ^1.4.0
flutter_chips_input: ^1.2.0
intro_slider: ^1.2.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_icons:
android: "ic_launcher"
ios: true
image_path: "assets/images/ic_launcher.jpg"
# 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
# To add assets to your application, add an assets section, like this:
assets:
- assets/images/
- assets/
This is my pubspec.YAML file.
I have installed flutter and tried to run an existing flutter project on iPhone.
When I try running flutter, I get this error.
I tried searching for solutions but couldn't find one. Can anyone let me know what needs to be done?
I cannot find fluttery package in pub
Maybe is deleted. Check fluttery_dart2 as an alternative.
This is happening because flutter configured podfile that way. Default generated podfile by flutter won't allow ios build to download the nested dependencies.
To resolve you can alter podfile file by this and your issue would be resolved.
Search for this piece of code
target 'Runner' do
# Flutter Pod
And replace it with below
target 'Runner' do
use_frameworks!
# Flutter Pod
Update
Fluttery package is removed/temporary down due to flutter upgrade. So you should update your pubspec.yaml file with
fluttery_dart2: ^0.0.9
library to use the same functionality. Well this library will not be for long time once the original one will back.
Please read the note here

Has anyone seen this compile error with stripe_payments on iOS flutter?

I am running a flutter app on iOS with stripe_payment ^0.1.0.
The demo run with only stripe_payment package builds and runs fine.
It doesn't compile when I have multiple packages in my pubspec.
Tried clearing the pub cache and run flutter packages get, tried deleting pod file and run pod install again
Error:
/Users/../flutter/.pub-cache/hosted/pub.dartlang.org/stripe_payment-0.1.0/ios/Classes/STPAddSourceViewController.m:42:32: error: property 'managedAccountCurrency' not found on object of type 'STPAddSourceViewController *' cardParams.currency = self.managedAccountCurrency; ^ 6 warnings and 1 error generated. Could not build the application for the simulator. Error launching application on iPhone Xs. Exited (sigterm)
My pubspec has the following dependencies:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_local_notifications:
cupertino_icons: ^0.1.2
firebase_auth: ^0.14.0
firebase_core: ^0.4.0+8
cloud_firestore: ^0.12.9
google_sign_in: ^4.0.6
firebase_messaging: ^5.1.2
url_launcher: ^5.0.1
flutter_auth_buttons: ^0.3.1
geolocator: ^5.1.1
stripe_payment: ^0.1.0
cloud_functions: ^0.4.1
Does anyone know where this error is coming from?
I think it a conflict with one of the other packages, but not sure how to find that
I just updated the plugin to support the latest Stripe plugins on Android and iOS, which should have fixed your issue:
https://pub.dev/packages/stripe_payment/versions/0.1.1
I've changed my Podfile with:
platform :ios, '10.0'
And after flutter clean I can compile my project.

Flutter ios - app works on simulator fails on deploying to iphone - library not found for -lFirebaseCore

As the title states I can run my app on ios simulator but when I attempt to deploy my app to the iphone through Xcode I get the error message
:-1: library not found for -lFirebaseCore
Any suggestions on what I might be doing wrong ? This is my pubspec.yaml
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.0
http: "^0.11.3+16"
crypto: any
validate: "^1.6.0"
json_annotation: ^0.2.4
image_picker: "^0.4.1"
firebase_messaging: ^2.1.0
device_info: ^0.2.1
location: ^1.4.1
cached_network_image: "^0.4.1"
mutex: #"^0.0.1"
logging: "^0.11.3+1"
uuid: ">=1.0.0"
web_socket_channel: ^1.0.9
dev_dependencies:
flutter_test:
sdk: flutter
build_runner:
json_serializable: ^0.5.2
Any suggestions are more than welcome. Thanks
I don't remember exactly, but you have to include either firebase_database or firebase_auth in pubspec.yaml. I'll make a test and update this later.
Try cd into the iOS folder of your flutter projects directory and run
pod install

flutter Got socket error trying to find package android_alarm_manager: ^0.1.0

I just tried to get package from pubspec.yaml (with flutter packages get command) in my Flutter project but it raised this error :
Got socket error trying to find package android_alarm_manager: ^0.1.0"
I'm working on my company computer (Windows 7) that is behind proxy but I absolutely have no problem for other packages (ex. font_awesome_flutter: 6.0.0).
I tried with flutter beta version.
pubspec.yaml
name: background
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.0
font_awesome_flutter: 6.0.0
android_alarm_manager: ^0.1.0
isolate: ^2.0.0
dev_dependencies:
flutter_test:
sdk: flutter
uses-material-design: true
remove the proxy you are using first then get the package again

Resources