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 am working on an existing ReactNative project to add new features to the IOS app. But I tried to build and run the IOS app using "react-native run-ios" command, I am getting the following error.
Could not find "Podfile.lock" at null.lock. Did you run "pod install" in iOS directory?
To resolve the problem, first I run the following command in the ios folder of the project.
pod install
When I do that, I am getting the following error in the console.
[!] No `Podfile' found in the project directory.
To solve that error, I tried doing the following:
I run "sudo gem install cocoapods"
Then in the ios folder I run "pod init"
Then I run "pod install" within the ios folder
Then I got the following error:
[!] The target `xxxxxx xxxTests` is declared multiple times.
I removed the repeating one in the Podfile and tried running pod install again. This time it run but I am getting the following warning.
[!] The Podfile does not contain any dependencies.
[!] Automatically assigning platform `iOS` with version `12.0` on target `Inventory Smart` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
[!] Automatically assigning platform `tvOS` with version `12.0` on target `Inventory Smart-tvOS` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
When I run react-native run-ios, I am getting the following error.
error Could not find "Podfile.lock" at null.lock. Did you run "pod install" in iOS directory?
How can I solve the issue?
Solution 1: The target xxxxxx xxxTests is declared multiple times.
It is pretty much prominent that your Podfile consists of the target xxxxxx-xxxTests multiple times. You just have to go inside the Podfile, and remove the duplicate problematic target xxxxxx-xxxTests code.
It will somehow look like this, you just have to remove one of the two declared code from the Podfile
target 'xxxxxx-xxxTests' do
inherit! :search_paths
# Pods for testing
end
You will be able to run the app now, you just have to do the below commands after you're done with the above fix.
pod install
cd ..
npm run ios
UPDATED ANSWER
Solution 2: Automatically assigning platform iOS with version 12.0
In your top section of Podfile, uncomment # podfile :ios, 'x.0' by removing # from the referred code, here x is the version number which would be there by default, so do not get confused. Or just mention this line globally, podfile :ios, '10.0'. This should ideally fix your issue.
Then run the following commands:
cd ios && rm -rf Pods
pod install
cd ..
react-native run-ios
I've update my flutter package to the last versions and now IOS doesn't work anymore.
When I try to update the pods it's shows this error:
[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly":
In Podfile:
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 0.0.1, which depends on
Firebase/Firestore (~> 6.0) was resolved to 6.0.0, which depends on
Firebase/CoreOnly (= 6.0.0)
cloud_functions (from `.symlinks/plugins/cloud_functions/ios`) was resolved to 0.0.1, which depends on
Firebase/Functions (~> 5.18) was resolved to 5.18.0, which depends on
Firebase/CoreOnly (= 5.18.0)
Here my pubspec.yaml (Firebase related):
firebase_core: "^0.4.0"
firebase_auth: "^0.11.0"
firebase_analytics: "^3.0.0"
cloud_firestore: "^0.11.0+1"
cloud_functions: "^0.3.0"
firebase_storage: "^3.0.0"
firebase_messaging: "^5.0.1"
I've made various steps to try to fix:
flutter clean
flutter build ios
pod install
pod update
pod repo update
pod install --repo-update
I've set platform :ios, '12.1' in Podfile and in Xcode as build target but nothing come back to works.
Here my podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '12.1'
# 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
pods_ary = []
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { |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)
pods_ary.push({:name => podname, :path => podpath});
else
puts "Invalid plugin specification: #{line}"
end
}
return pods_ary
end
target 'Runner' do
use_frameworks!
# 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')
# Flutter Pods
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
if generated_xcode_build_settings.empty?
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
end
generated_xcode_build_settings.map { |p|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
symlink = File.join('.symlinks', 'flutter')
File.symlink(File.dirname(p[:path]), symlink)
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
end
}
# Plugin Pods
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.map { |p|
symlink = File.join('.symlinks', 'plugins', p[:name])
File.symlink(p[:path], symlink)
pod p[:name], :path => File.join(symlink, 'ios')
}
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
Try calling pod repo update
if the issue is not fixed
delete the Podfile.lock in the root directory, after that run pod install
Edit the minimum ios version in the podfile then run pod install.
Changing platform :ios, '9.0' to platform :ios, '10.0' then running pod install fixed it for me.
For M1 Mac Users
Go to ios/Pods/Local Podspecs directory in your project
Check every json file to find highest required iOS version. Mine was "ios": "10.0" in some of them
Go back to ios/ directory
Open Podfile file
Uncomment # platform :ios, '9.0' and replace 9.0 with version from step 2. - for example 10.0.
then here comes the M1 specific part
Run sudo arch -x86_64 gem install ffi
Run arch -x86_64 pod repo update
Run arch -x86_64 pod install error should be gone
If using Flutter cd - back to your root directory - open iOS Simulator & run flutter run
If not working you might need to run flutter pub add firebase_coreto add firebase_core to your pubspec.yaml file Before Step 1
If still not working try this BONUS STEPS :
Trying to Run directly from Xcode ? First Run flutter build iOS in your Flutter project -> then Run in Xcode
Still not working cd iOS run rm -rf Pods/ Podfile.lock ; pod install
Still not working ? Search Keychain Access in Spotlight -> open -> Right-click on login -> Unlock (you will lock back when build succeeds)
Still not working ? make sure your Runner Info Configs look like this
Just do a pod update and then pod install. This worked for me.
Execute flutter clean
Go to ios/ folder, edit Podfile and choose the platorm and version you want to launch. For example for platform ios and version 12.0 :
Podfile
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
Execute pod update
Execute pod install (it can take a some minutes to download dependencies)
Execute flutter run
If you are using an M1 mac.
Delete podfile.lock by running
arch -x86_64 rm -rf Podfile.lock
and then update pods by running
arch -x86_64 pod install --repo-update
To use the "firebase_core" dependency with version ^1.0.3, the "iOS Deployment Target" has to be not less than "10.0"
For M1 Mac,
It is easiest and fastest to find the answer in the last part.
move to folder ios:
cd ios
Method 1:
Open your terminal and run
sudo gem uninstall cocoapods
sudo gem install cocoapods
restart IDE or Editor
Method 2:
Note: Try only if Method 1 will not work
Now time to install pod for M1 Mac:
sudo arch -x86_64 gem install ffi
arch -x86_64 pod repo update
arch -x86_64 pod install
Now 99% chance installation error should be gone
Now only for the 1% chance that you are still getting errors:
open your ios Runner XCode project and follow the image instructions.
Change your Excludeed Architectures from Architectures for Target
form i386 to arm64 i386 (Note: space is important)
Now come back to your root directory and run
flutter run
Also, Restart your editor.
Advance Note:
Getting this error multiple times and copy-pasting each time fixes it.
Therefore, I am here to offer a better way to accomplish this with the help of method 2:
Copy below the Written code
#!/bin/bash
pwd
sudo arch -x86_64 gem install ffi
arch -x86_64 pod repo update
arch -x86_64 pod install
You will need to create a script file in your IOS Folder, let's call it pod_install.sh
Should you ever encounter the same problem again, you will only need to run one command.
sh pod_install.sh
from your ios folder
now enter the password of your mac
now tea ☕ time 😀
Don't forget to Restart your editor.
I just ran into this same issue when trying to add Firebase Analytics to my projct. I kept running pod update in the terminal, but I couldn't successfully get to FirebaseCore (6.0.0) until I made sure that all flutter packages in the pubspec.yaml file were on the latest version.
1) I got rid of the package that was causing the error. For me, it was Firebase Analytics because I had just added that to my project.
2) I went through all of the firebase packages and made sure I had the most recent version in my pubspec.yaml. Here they are:
firebase_core: ^0.4.0
firebase_database: ^3.0.0
firebase_auth: ^0.11.0
firebase_storage: ^3.0.0
3) Navigate to ios folder and run pod update
4) Add Firebase Analytics package (or whatever you are interested in adding) to pubspec.yaml.
5) Run packages get
6) Run pod install in terminal
The simple solution worked for me (Suggested by the IDE itself)
pod install --repo-update
Run the command in terminal IOs folder
March 2021
cloud_firestore: ^1.0.0
cd ios
rm Podfile.lock
pod repo update
In React Native
cd ios
rm -rf Podfile.lock
pod install
pod update then pod install. This worked for my side
For me this worked
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
Worked for me when i added the highest ios version dependency from the symlinks/plugins in the Podfile platform :ios, '11.0'
As of 28 April 2021, what worked for me (after days of struggle):
In AppDelegate.swift (flutter-project/ios/Runner), add these 2 lines:
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
In Terminal:
pod repo update
flutter build ios
Then run your project in Xcode.
Go back to the ios folder and open the Podfile then change platform as below platform :ios, '10.0'. After that click the run button from your Editor.
At first delete podfile.lock file from your ios folder
then goto your ios folder from terminal
cd ios
now type in terminal
pod repo update
pod install
or
pod install
pod repo update
This migration guide for react-native-firebase could be useful for your case:
https://rnfirebase.io/migrating-to-v6#removing-v5-from-javascript
I uninstalled version 5 and installed version 6, but it seems there was some extra work to do to get rid of older versions of firebase.
Delete Podfile
pod init
pod install
Worked for me
Here's what worked for me.
delete the Podfile.lock in the ios directory
after run arch -x86_64 pod install
This issue has been so annoying. But this is how I solved it.
1- First of all, I updated the firebase packages.
firebase_core: 1.10.0
firebase_auth: 3.4.1
2- I went into the Android studio terminal and wrote it.
cd ios
pod deintegrate
pod repo update
3- in the ios folder
I deleted the .symlinks folder
4- Finally,I also wrote in Terminal
pod install
If it still fails, change the firebase updates from step 1 and repeat the other steps.
The problem is in cloud_functions plugins.
They have 5.18 version of Firebase.
For fix it you must change manually the file cloud_functions.podspec in the ios folder of the plugin while their doesn't finally fix.
Change it
s.dependency 'Firebase/Firestore', '~> 5.18'
to
s.dependency 'Firebase/Firestore', '~> 6.0'
After that still remaing an error regarding some missed dependencies of Firebase functions files.
I add directly in the pod this line:
pod 'Firebase/Functions'
I know that all this is an workaround but works in this way for me.
I had to follow this answer and do 2 things
1- In my Podfile I had platform :ios, '13.0', I had to switch it to platform :ios, '10.0'
2- I had to remove my entire podfile and reinstall it but this time for the Firebase/Database pod I used pod 'Firebase/Database', '~> 7.0.0'
My podfile looks like this now:
platform :ios, '10.0'
install! 'cocoapods', :deterministic_uuids => false
target 'MyApp' do
use_frameworks!
# Pods for MyApp
pod 'Firebase/Database', '~> 7.0.0'
// other pods ...
I fixed that issue.
I guess you add new firebase package and then issue appear.
remove last added packages
run flutter clean
delete podfile.lock
Ensure all firebase packages use updated version
run flutter pub get
go cd ios/
run pod install
Then fixed.
Go back to pubspec.yaml and make sure the flutter fire packages are all compatible together. My issue was because firebase_remote_config version was slightly newer than the cloud firestore and consecutively caused the error when I ran Pod update.
Simple solution that worked for me, this was being caused because I was using an older version of a Firebase dependency. So upgrading all dependencies and then using flutter pub get and flutter run worked for me
My podfile had this line commented platform :ios, '11.0' and set to 11 i uncommented and changed to 14
My scenario, I am trying to Implement app update notification for my application. I tried Siren Pod but It is showing no module found. Please provide me a solution or alternative ideas.
Siren Pod
Siren Link
Here, i am getting No Module Found after pod installation also.
Import Siren // No module found
Did you open your .xcworkspace or .xcodeproj? This error message is one that you’d get if you accidentally opened the .xcodeproj.
Following the Siren installation instructions for cocoapods, you’d do something like the following in your “Terminal” window. Specifically, if you hadn’t created the Podfile yet:
$ cd MyApp
$ pod init
And you can edit your Podfile, something like:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'Siren'
end
Then you can do can install your Cocoapods from the “Terminal”:
$ pod install
Analyzing dependencies
Downloading dependencies
Installing Siren (4.2.1)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `MyApp.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
[!] Automatically assigning platform `ios` with version `12.1` on target `MyApp` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Note the warning:
Please close any current Xcode sessions and use MyApp.xcworkspace for this project from now on.
And now open the workspace, not the .xcodeproj:
$ open MyApp.xcworkspace