Flutter Error on Real iOS Device: "module 'fluttertoast' not found" - ios

My flutter app is working properly in iOS Simulator.
I have added fluttertoast by:
Adding it on pubspec.yaml
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.3
fluttertoast: ^7.0.1
Importing in my dart file
import 'package:fluttertoast/fluttertoast.dart';
So far it works as intended. BUT, when I move to a REAL iOS device, my iPhone XS, It won't compile.
I get this error:
fatal error: module 'fluttertoast' not found
#import fluttertoast;
What am I missing?

Suprisingly, I made it work just now.
What I did:
Tried to modified the podfile.
Tried to run it. Error due to podfile.
Revert podfile to original state.
Tried to build, pop-up asking something like 'would you like to use Xcode version or version on disk (I used Xcode version before which may have caused the problem)
I chose to use VERSION ON DISK.
Program is now working on real iOS device.
So whenever you get the pop-up asking "which version to use", always choose "VERSION ON DISK".
Thanks guys

I have face this issue very recently and the way I fix is like this. I change the pod file min deployment to 11 as needed by some of the pacakges I was using like flutter stripe. but the issue was that in Xcode the deployment was set to 9.0(not changing to 11.0). which was causing the issue to fix the issue follow the step.
1 : delete to /iOS/podfile.lock (if any)
2 : go to /iOS/podfile (platform :ios, '9.0') replace the 9.0 with version required for your packages/app.
3 : in terminal cd ios (pod install)
4 : edit the deployment info version here as well in Xcode
5 : run the app it will work if building archive build archive it will not throw the error.

Today I am facing the same problem, what I do is switch to the project ios folder, run this command:
pod repo update
pod install
from the log output, we can found the pod install the fluttertoast dependencies:
➜ ios git:(master) ✗ pod install
Analyzing dependencies
Downloading dependencies
Installing FMDB (2.7.5)
Installing Flutter (1.0.0)
Installing SwiftAudioEx (0.14.7)
Installing Toast (4.0.0)
Installing device_info_plus (0.0.1)
Installing flutter_secure_storage (3.3.1)
Installing fluttertoast (0.0.2)
Installing in_app_purchase_ios (0.0.1)
Installing music_player (0.0.1)
Installing path_provider_ios (0.0.1)
Installing shared_preferences_ios (0.0.1)
Installing sqflite (0.0.2)
Installing system_clock (0.0.1)
Installing url_launcher_ios (0.0.1)
Installing video_player_avfoundation (0.0.1)
Generating Pods project
Integrating client project
Pod installation complete! There are 12 dependencies from the Podfile and 15 total pods installed.
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).
then build the project in xcode success.

I Deleted podfile.lock
I Just Commented
platform :ios, '11.0'
enter image description here
Then I Run pod install

Related

flutter_native_image not found in xcode build, but pod install log shows otherwise

I have made an app which uses flutter_native_image, image_picker and image_cropper to take pictures and resize them at will. On Android build it works flawless.
While running XCode build to make this work on iOS, the build fails because packages cannot be found, although I followed (to my newbee knowledge) all necessary steps
Steps I did to create a clean build on iOS:
flutter clean
flutter pub get
pod deintegrate; pod install
In the log of the pod install, I can see that the necessary packages are being installed. See log below
#LMAC-C02F5662MD6R ~/work/git/boekelaar/bierpot/frontend/ios> pod deintegrate; pod install
Deintegrating `Runner.xcodeproj`
Deleted 1 'Check Pods Manifest.lock' build phases.
Deleted 1 'Embed Pods Frameworks' build phases.
- Pods_Runner.framework
Deleting Pod file references from project
- Pods-Runner.debug.xcconfig
- Pods-Runner.release.xcconfig
- Pods-Runner.profile.xcconfig
Deleted 1 empty `Frameworks` groups from project.
Removing `Pods` directory.
Project has been deintegrated. No traces of CocoaPods left in project.
Note: The workspace referencing the Pods project still remains.
Analyzing dependencies
Downloading dependencies
Installing Flutter (1.0.0)
Installing TOCropViewController (2.6.1)
Installing flutter_native_image (0.0.1)
Installing image_cropper (0.0.4)
Installing image_picker_ios (0.0.1)
Installing path_provider_ios (0.0.1)
Installing shared_preferences_ios (0.0.1)
Generating Pods project
Integrating client project
Pod installation complete! There are 6 dependencies from the Podfile and 7 total pods installed.
After this install, I tried to build this on a physical device (iPhone X with iOS 15) and my XCode build failed here:
Screenshot of XCode build failure
Does anyone have any clue or ideas?

Consistency issue: build setting `IPHONEOS_DEPLOYMENT_TARGET` has multiple values

I generated new flutter module project for my existing app which has set iOS target to 15.0
I was following https://docs.flutter.dev/development/add-to-app/ios/project-setup this guide with option A but I'm getting this after pod install:
Analyzing dependencies
Downloading dependencies
Installing Flutter (1.0.0)
Installing FlutterPluginRegistrant (0.0.1)
Generating Pods project
[!] An error occurred while processing the post-install hook of the Podfile.
[Xcodeproj] Consistency issue: build setting `IPHONEOS_DEPLOYMENT_TARGET` has multiple values: `{"Release"=>"13.0", "Debug"=>"13.0", "Production"=>"15.0", "Store"=>"15.0"}`
I tried changing the iOS version in pod file by setting target to 15.0 but its not working.
Changing anything in flutter .iOS dir is also not working

CocoaPods could not find compatible versions for pod "CordovaPlugins"

I've run into an issue with my Ionic app, noticing since Capacitor was being updated. I do have Cordova plugins installed and have followed the instructions as per the Ionic documentation when installing these into the app.
I have tried removing and updating Cocoapods, Pod install etc and nothing seems to solve this problem.
The error shows as follows:
[!] CocoaPods could not find compatible versions for pod "CordovaPlugins":
In Podfile:
CordovaPlugins (from ../capacitor-cordova-ios-plugins)
Specs satisfying the CordovaPlugins (from ../capacitor-cordova-ios-plugins) dependency were found, but they required a higher minimum deployment target.
Any ideas on how to fix this?
Thanks in advance!

The 'Pods-Runner' target has transitive dependencies that include statically linked binaries

Here's Flutter and Xcode versions:
Flutter 1.22.5 • channel stable
Version 12.3 (12C33)
I have a Flutter application and I get the following error when trying to install the pods:
The error message was about AgoraRtcEngine, previously I was using agora 3.2.1 and the error message complained that I need 3.3.1 and then I upgraded it.
Then I try to install all the dependencies, unfortunately, I got the The 'Pods-Runner' target has transitive dependencies that include statically linked binaries error.
I tried below commands but failed with the attached error:
flutter clean
remove ios/Flutter/Flutter.framework
remove PodFile and PodFile.lock
flutter build ios
Does anyone know what is the cause and how to solve it? Thanks.
You might want to update CocoaPods, what version are you currently using
https://github.com/CocoaPods/CocoaPods/issues/7234#issuecomment-346119807
follow the instructions that are given in terminal output:
sudo gem install cocoapods
you might wanna upgrade your CocoaPods and also your flutter version
upgrading your installing CocoaPods -> "sudo gem install cocoapods"
this will take a while or throw error, incase of error try manually downloading cocoapods from web " https://cocoapods.org/app " this will download a dmg application file.
and for flutter
try "flutter upgrade"

Why doesn't this iOS project build using XCode 11?

I have an iphone app (Swift project) that used to build using an older version of XCode, but I haven't built it for a year (I updated my XCode) and now I can't build it. I tried everything I found after googling the problem. I get this error every time I try to build it:
unable to spawn process (No such file or directory) (in target 'CombineDataSources' from project 'Pods')
I don't get any other error when I try to build the project, just this one.
I tried cleaning the build folder, deleting all pods (Library/Cashes/CocoaPods/Pods), deleting derived data (Library/Developer/XCode/DerivedData), deleting the xcworkspace file, then running pod deintegrate command in terminal, then running pod install command in terminal.
Analyzing dependencies
Downloading dependencies
Installing CombineDataSources (0.2.2)
...
Generating Pods project
Integrating client project
Pod installation complete! There are 14 dependencies from the Podfile and 20 total pods installed.
Podfile (part that contains the package that's part of the Xcode error):
pod 'CombineDataSources', '~> 0.2.2'
Podfile.lock (part that contains the package that's part of the Xcode error):
PODS:
- CombineDataSources (0.2.2)
DEPENDENCIES:
- CombineDataSources (~> 0.2.2)
SPEC REPOS:
trunk:
- CombineDataSources
SPEC CHECKSUMS:
CombineDataSources: 2315365365i8746865375
All pods were successfully installed, no errors, no warnings, but my project still gives the unable to spawn process error. Anyone has any idea what else I could try? Any help, any suggestion would be very much appreciated!
I cannot manage to find the spec 0.2.2 in neither the CombineDataSources nor in the specs repo;
The 0.2.2 release seems that doesn't contain the podspec.
In repo not found: https://github.com/CombineCommunity/CombineDataSources/tree/0.2.2
In cocoapod specs not found:
https://github.com/CocoaPods/Specs/search?q=combinedatasources&unscoped_q=combinedatasources
Only the latest version seems to contain a podspec. (0.2.5)
Could you try with to pod install or bundle exec pod install with that version?

Resources