Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Podfile and Pods folders not created in ios directory

Tags:

ios

flutter

Created a new flutter project from Android Studio using the wizard.

Newly created project folder does not have any of the Pods folders or podfile in the ios directory.

This Flutter.io page states (emphasis mine):

While there is a Podfile in the iOS folder in your Flutter project, only use this if you are adding native dependencies needed for per-platform integration.

There is no podfile at all in my ios directory.

I found this comment in a different question here suggesting running the project on the ios simulator would generate the file but running the project on the sim and device both do not result in any podfile creation for me.

Is there some step in the ios side of the new flutter project creation that I missed? There's no way for me to add ios-specific dependencies without the podfile.

Output of flutter doctor:

[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.12.6 16G1408, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
[✓] Android Studio (version 3.1)
[!] VS Code (version 1.25.1)
[✓] Connected devices (1 available)
like image 245
aaronfg Avatar asked Jul 30 '18 17:07

aaronfg


People also ask

Where is Podfile in IOS?

The Podfile is located in the root of the Pods project. An easy way to open it is via "Open Quickly" (Shift Cmd O) typing Podfile.

Where do you put pods in Podfile?

Run open Podfile. Which opens the Podfile in textEdit. Add pod'CorePlot', '~> 1.4' to it and save. Run pod install -- NOTE* that is **pod update if already installed.

Why isn't the flutter POD file automatically created for iOS packages?

When we started the project, there were no packages added to flutter so the pod file wasn't automatically created. It appears that when we created our own pod file to support iOS packages without adding the flutter packages first, the default flutter pod initialization was missed. Flutter does not add it into the pod file if one already exists.

Is there a podfile in the newly created Project folder?

Newly created project folder does not have any of the Pods folders or podfile in the ios directory. While there is a Podfile in the iOS folder in your Flutter project , only use this if you are adding native dependencies needed for per-platform integration. There is no podfile at all in my ios directory.

Is it possible to delete a podfile in flutter?

The Podfile isn't supposed to be deleted out from under you. /// on themselves. @rashedmyt At the moment the presence of the Podfile indicates that pod install needs to be run during flutter run because, as this issue shows, people may have their own Podfile that doesn't use Flutter plugins so the tool doesn't know about it.

Why is url_launcher not working in my flutter pod?

It appears that when we created our own pod file to support iOS packages without adding the flutter packages first, the default flutter pod initialization was missed. Flutter does not add it into the pod file if one already exists. After manually adding in this configuration change and linking, url_launcher works.


2 Answers

Here is what I usually do:

  1. go into ios folder
  2. delete the Podfile.lock file
  3. rm -rf Pods
  4. pod cache clean --all
  5. pod deintegrate
  6. pod setup
  7. pod install

You may also want to do

pod repo update

like image 182
LiveRock Avatar answered Oct 17 '22 15:10

LiveRock


Once you run flutter build ios a Podfile and Podfile.lock will be created for you in the ios directory.

Follow the steps in the deploy steps official documentation.

like image 37
Pablo Rocha Avatar answered Oct 17 '22 15:10

Pablo Rocha