I'm using firebase_app_check package. All good. The following command works as expected.
flutter build ios
But as soon as I add the following in the Podfile(ios)
pod 'Firebase/AppCheck'
iOS build fails with this error:
Definition of 'GULAppEnvironmentUtil' must be imported from module 'GoogleUtilities.GULAppEnvironmentUtil' before it is required
What am I missing?
Try to run following command it may help you
run flutter clean
run flutter pub get
go to your project iOS directory and run pod install then run pod update
if this issue is because of outdated pod files
This question already has answers here:
Getting error "No such module" using Xcode, but the framework is there
(82 answers)
Closed 26 days ago.
I have published my app in TestFlight but it is crashing while startup. When I view crash logs, it say “No such module 'Flutter’”. I do know how to fix.
Thanks in Advance

Open IOS Folder in terminal ,
write
pod install
then
pod update
then it will work
This apparently a bug in XCode 13.1.
It is claimed by Flutter team to be a bug with the visual component of XCode... as evidenced by the fact that the project will still build and run from XCode.
There are many reported ways to get rid of it temporarily, such as doing Product\build , Product\Clean Build Folder, or running the project on IOS from within Android Studio...
But these are only temporary and the problem will reappear.
https://github.com/flutter/flutter/issues/92337
Just did like #Tasnuva said, and it worked in my case:
Remove podfile.lock file and Pods folder
Run pod install then pod update
Reopen Runner.xcworkspace
No such module Flutter still exist, just ignore and run as usual
No such module flutter suddenly disappear after build succeed
Try this steps. Checked on XCode 14.1
Make sure that you open xcworkspace instead of xcodeproj. xcworkspace - contains information about pods.
flutter clean
flutter pub get
pod install
The error all the same will be display
Try to build. Build should be succeeded and the error disappear.
i just removed Podfile.lock and Pods folder then run pod install
You shouldn't need to touch pod directly. Instead, you can remove ios/Pods and then:
flutter clean
flutter pub get
flutter build ios
Which has come up in a related issue before, e.g. https://github.com/flutter/flutter/issues/73845#issuecomment-879428744
In my case it was me not putting
install_all_flutter_pods(flutter_application_path)
in the Podfile
for target 'my_app'
I added it for the testing target but not the project...
than pod install
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'my_app' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for counter_app
flutter_application_path = '../flutter_project'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
install_all_flutter_pods(flutter_application_path)
target 'my_appTests' do
inherit! :search_paths
# Pods for testing
install_all_flutter_pods(flutter_application_path)
end
target 'my_appUITests' do
# Pods for testing
install_all_flutter_pods(flutter_application_path)
end
end
This problem occurs when you have changed your podfile and the pod install command does not work
The piece of code mentioned below is not executing inside your podfile.
flutter_install_all_ios_pods
Fix this out then run
flutter pub get
cd ios && pod install
I have an error when I tried to launch my project on my iPhone, the basic Flutter example is working on my iPhone but when I use my project I have this error.
In Flutter project, I Also faced with this issue. Fixed by updating flutter and cocoa pods to the latest version.
Solution:-
flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
flutter pub get
cd ios
pod install
arch -x86_64 pod install //(On an M1 mac use => arch -x86_64 pod install)
cd ..
flutter build ios
flutter run
You can fix it with
sudo arch -x86_64 gem install ffi
I got this error when I was using Firebase in flutter, the solution for me was to set the Podfile deployment target to a iOS version higher than 9.
Example:
Changed this
#platform :ios, '9.0'
to
platform :ios, '13.0'
And as #Mana commented, remember the higher the version you set, your app will not be supported for users with lower IOS versions
I faced the same issue and none of the above work. Finally I resolved it by:
Check ios/.symlinks/plugins contains extra plugin which you are not using.
Delete podfile.lock in ios folder, if it exists.
Delete podfile from ios folder.
Delete pods folder in ios directory.
Run flutter clean in the terminal.
Run flutter pub get in the terminal.
Run flutter runin the terminal.
2022 update
After struggling for hours the following helped me:
sudo gem uninstall cocoapods
brew install cocoapods
Make sure you have HomeBrew installed before you do the above. Steps to install HomeBrew: Install HomeBrew
For Mac M1, try the following commands. Worked for me fine
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
Change directory to your project; e.g /dart/apps/abc
Type, flutter clean && pod update
So did you solve this problem?
I met the same situation. And this is the solution I found.
Link
Basically:
Locate Terminal.app in Finder. (Applications->Terminal.app)
Right-click and choose Get Info
Check the “Open using Rosetta”
Quit all instances of Terminal app and run it again
Run sudo gem install ffi
After you finish the above several steps, restart your IDE and re-run the application.
Please give a reply if this method works.
I'm using VS Code and flutter 2.10.1
running intel mac
I've faced this problem several times, usually when switching between projects or when working with multiple versions of project. But the solution is pretty simple.
Inside your project parent directory go to, ios -> Podfile. Here the top line will be something like this,
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
check whatever version you are using on simulator and replace '9.0' with that and uncomment.
# Uncomment this line to define a global platform for your project
platform :ios, '15.4'
Now if we try to run the flutter project, the debugger will say that the cocoapods are outdated. So just update them using command
pod repo update
And that should solve the problem.
Simply delete the Podfile from your project
Run this command in terminal (I did in Android studio terminal it self)
sudo gem install cocoapods
And then run this
pod init
It works for me..
The link https://cdn.cocoapods.org does not work correctly, I had to change the source in ios/Podfile as described in the code below:
Change source in ios/Podfile
# platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'
Clean your project
flutter clean
Install referenced packages
flutter pub get
Run the app
The error can also come from a package which requires a version higher than '9.0' in this case it is necessary to uncomment the line # platform :ios, '9.0' and to pass for example to version '14.0' according to the version requested by the package.
Delete the podfile.lock (located in app root > ios folder)
Run in Terminal pod install --repo-update
flutter run
There are multiple reasons this could occur so a one-size-fits-all solution won't exist.
Instead, in terminal, run:
$cd ios
$pod install
This will give you more in depth information on the error and you can search from there. In my case one of my dependencies required a higher minimum ios version so I had to open the .xcworkspace file and adjust the minimum deployment version in xcode>targets>general>minimum_deployments
For me none of the above helped, the following worked on my case:
Deleted the macos folder from main project.
Created a dummy flutter project.
Copied the newly created macos folder.
Pasted it to my main project.
Additionally I use firebase plugins, so I made some changes in pod file,..
It started running.
I'd the same problem, in my case when I ran pod install --verbose I realize that there was an specific error during pod install
undefined method `each_child' for #Dir:0x00007ff10befa7f0 Did you mean? each_slice
Looking for this specific error I found this answer and I realize that I was using ruby 2.5 and one file generated by Flutter for iOS devices was trying to use a method that was introduced on version 2.6.
After follow the steps on that answer I could run my Flutter app on iOS simulator.
The method dir.each_child was introduced in Ruby 2.6, but you are using Ruby 2.3.0.
You should update Ruby to 2.6.0 or later 2.x version.
After Ruby updating you may also need to restart your IDE and re-install cocoapods.
Check in ios/.symlinks/plugins for unused plugins. and if there are, remove from pubspec.yml. This solved my problem.
As per the install instructions make sure M1 users run. Solved the issue for me. I missed it on install!
$ sudo softwareupdate --install-rosetta --agree-to-license
run this code on the terminal
sudo arch -x86_64 gem install ffi
Next, go to the ios folder in your project, and open Podfile.
Then change #platform :ios, '9.0' to platform :ios, '10.0'
I solve the same issue so:
Delete podfile.lock in iOS-folder app
Run pod repo update in the terminal
Re-compile my code
I had similar problems running flutter web on mac.
Make sure you uncomment and update the podfile from macos folder not ios
I'm talking about these lines:
# Uncomment this line to define a global platform for your project
platform :osx, '15.4'
If you want an automated script to change the deployment target, use
sed -i '' 's/9.0/10.0/' ./.ios/Podfile
where 9.0 is the generated iOS version and 10.0 the desired
on your pipeline, shell script or whatever
If anyone is struggling on M1 machines with a particular pod, the following helped me:
flutter precache --ios
arch -x86_64 pod update Firebase/Firestore //or name of pod from the error
Open Your Terminal paste this line of code open ~/.zshrc press Enter
if you don't have the zshrc file you will have to create it, to create it you need to open terminal paste this code touch ~/.zshrc add you flutter path and move to Second instruction
2 The Text File will open add then you add this export LANG=en_US.UTF-8
I have built an Ionic 2 app which uses Intercom (a third-party extension). Intercom is installed using cocoapods.
When compiling my app I am given the errors:
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
This is being generated by the Build Phase [CP] Check Pods Manifest.lock:
diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
if [ $? != 0 ] ; then
# print error to STDERR
echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." >&2
exit 1
fi
# This output is used by Xcode 'outputs' to avoid re-running this script phase.
echo "SUCCESS" > "${SCRIPT_OUTPUT_FILE_0}"
I have tried outputting the environment variables PODS_PODFILE_DIR_PATH and PODS_ROOT in the STDERROR echo from the script above and both are blank. I can probably get around this specific error by amending those paths myself, but clearly something else more fundamental is broken, so I need to fix the actual issue itself.
Why are these variables blank?
I have additional build phases for [CP] Copy Pods Resources and [CP] Embed Pods Frameworks which run some shell scripts. I have tried changing the order of these with no luck.
My Podfile.lock and Podfile (which was auto-generated anyway) both seem good:
Podfile:
# DO NOT MODIFY -- auto-generated by Apache Cordova
platform :ios, '8.0'
target 'niix' do
project 'niix.xcodeproj'
pod 'Intercom', '~> 3.2.2'
end
Podfile.lock:
PODS:
- Intercom (3.2.12)
DEPENDENCIES:
- Intercom (~> 3.2.2)
SPEC CHECKSUMS:
Intercom: 3119e8ebf76d3da425bab717a08067398fcabfe6
PODFILE CHECKSUM: f99283bb8a4e56cb037a02390d2fbc4e76c97db9
COCOAPODS: 1.3.1
There are no errors when running pod install, and all files I expect are present.
Things I have tried already:
Running pod install (of course)
Running pod deintegrate, running Product > Clean in XCode, re-running pod install
Manually deleting the Podfile.lock and Pods directory, running a Clean in XCode and then re-running pod install
A good nights sleep and another attempt the next morning!
Things to note:
I am running from project.xcworkspace not project.xcodeproj
I am running the latest stable version of XCode 8.3.3
I am running the latest version of Cocoapods 1.3.1
I've spent a long time trying to work this out and got nowhere. The app was built using Ionic 2, so the actual source code is stored elsewhere and built into a native XCode application.
Because of this I decided to delete the entire XCode directory. .xcodeproj, .xcworkspace, everything. I then rebuilt from Ionic.
On the second build I saw thats the Pods directory was there and everything was as it should be. I could compile and run first time without any issue.
My assumption is that the first build failed because I didn't have Cocoapods installed, so Ionic silently failed to run the pod install command upon set up. I guess it does something a little different to a traditional setup which is why I couldn't just run pod install afterwards.
So, in short, this was fixed by removing the iOS project:
ionic cordova platform rm ios
And re-adding it:
ionic cordova platform add ios
And then building:
ionic cordova run ios --device
But make sure you already have Cocoapods installed on your system first.
Trying to install Alamofire via Cocoapods. This is a brand new app with zero configuration. I've pod install the app and opened the project via it's workspace. Receiving following error using XCode 7.1.
ld: framework not found Alamofire
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Podfile
# Uncomment this line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'Bitcoin Watcher' do
pod 'Alamofire', '~> 3.1'
end
target 'Bitcoin WatcherTests' do
end
target 'Bitcoin WatcherUITests' do
end
Pods.framework is found in my Linked Frameworks and Libraries. This is absolutely frustrating as I've tried numerous solutions but none work. Cocoapods version is 0.39.
you should remember that when you install a new version of Xcode, before pod updating/installing, you should first do sudo gem install cocoapods. This will update all the gems which might have beenm deleted due to updating of Xcode.
Then remember next step is there should not be any fiels in target space relating to your dependencies, mentioned in pod. This will confuse your Xcode about the relevant files to use for using dependency.
Hence, ensure that dependencies files are mentioned in the pods folder only.
Next remember that in the linker path settings, you should use first $inherited for specifying the path of libraries.
This step should be done before installing any dependency.
Lastly cmd+ Shift +k -> Clean the project should be done before using pod Install from terminal.
Jason in your case xcode is unable to link framework, so do mentioned in above steps.
Hope it answer all your questions
If you are building a project for tvOS, you should specify
platform :tvOS, '9.0'
instead. I don't know if this will solve all of the problems, but it will get you closer for sure.
If you are using Cocoapods, check the version and update, clean and run the app
sudo gem install -n /usr/local/bin cocoapods
pod install
pod update