Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Running pod install..." infinitely

Tags:

ios

flutter

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.

like image 497
Haroon khan Avatar asked Apr 23 '19 10:04

Haroon khan


People also ask

How long does pod installation take?

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.

What is the difference between POD install and pod update?

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*.

What is the use of pod install?

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.


3 Answers

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.

like image 128
K K Avatar answered Sep 20 '22 18:09

K K


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
like image 28
Jude Gerhart Avatar answered Sep 24 '22 18:09

Jude Gerhart


use a terminal. go to your ios folder run pod install --verbose you will see what is going on

like image 45
Michael Dausmann Avatar answered Sep 22 '22 18:09

Michael Dausmann