I want to run my app flutter App on IOS Simulator but it says "running pod install..." infinitely
I tried to find a solution but couldn't find any.
Here is my pod file which was automatically generated by cocoa pod:
# 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 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
# 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
The expected result was "The app should run on IOS simulator soon" but it's stuck on "running pod install..."
And then gives the following error:
Automatically assigning platform ios
with version 8.0
on target Runner
because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform
.
This will take significantly less time as this requires fetching and downloading just the pods you need instead of whole cocoapods repository. In My case it reduced the pod update time from 15-20 mins on average to 3-4 mins at most. Show activity on this post.
You added a new pod to your Podfile This will install the latest version* of any new pods added to your Podfile, leaving your other pods unchanged. If you were to run pod update instead, it would install the new pods and update each of your existing pods to its latest version*.
Every time the pod install command is run — and downloads and install new pods — it writes the version it has installed, for each pods, in the Podfile. lock file. This file keeps track of the installed version of each pod and locks those versions.
Delete the podfile.lock
file from iOS folder after that go to ios folder and run a below command
Pod install
It will install all the packages which are in your podfile.
Also, you need to set the target platform. Stay in the iOS folder and run below command
open Runner.xcworkspace
then your app will be open in XCode. Click on the "Runner" and set your target platform to 8.0. I fix my iOS build issue using this hope this will work for you.
If you are developing on a recent M1 Mac with Apple Silicon, you may need an additional command after installing Cocoapods found here.
sudo gem install ffi
use a terminal.
go to your ios folder
run
pod install --verbose
you will see what is going on
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With