Cannot Install Cocoapods - No Podfile Found in the Project Directory

Cannot Install Cocoapods - No podfile found in the project directory

Steps to add CocoaPods to manage dependencies in your project:

  1. sudo gem install cocoapods -> This installs CocoaPods as a piece
    of software on your machine.

  2. Go to the root of your project directory and execute pod init ->
    This will add a base Podfile to your project.

  3. Add the external dependencies that you have to this Podfile by editing it.

  4. Run pod install which will fetch all the external dependencies
    mentioned by you, and associate it with a .xcworkspace file of
    your project. This .xcworkspace file will be generated for you if
    you already do not have one.

From here on, you should use .xcworkspace file instead of .xcproject / .xcodeproj.

Example Podfile Syntax:

target 'MyApp' do   
pod 'AFNetworking', '~> 3.0'
end

Where AFNetworking is the pod and 3.0 is the specific version that I want to install.

Documentation: Using CocoaPods

No `Podfile' found in the project directory in Flutter project

change your working directory to ios with:

   cd ios

and then run whichever pod commands you'd like

Azure pipeline error: No `Podfile' found in the project directory

Finally, I found the solution:

- stage: iOSStage
dependsOn: []
displayName: iOS
condition: always()
jobs:

- job: iOSJob
displayName: iOS
steps:

- task: FlutterInstall@0
displayName: "Install Flutter SDK"
inputs:
mode: 'auto'
channel: 'stable'
version: 'latest'

- task: InstallAppleCertificate@2
displayName: 'Install Apple Certificate'
inputs:
certSecureFile: '$(p12FileName)'
certPwd: '$(p12Password)'
keychain: 'temp'
deleteCert: true

- task: InstallAppleProvisioningProfile@1
displayName: "Install provisioning file"
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: '$(provisioningProfile)'

- task: Bash@3
displayName: '[Flutter] Configure Flutter'
inputs:
targetType: 'inline'
script: |
$(FlutterToolPath)/flutter doctor -v
$(FlutterToolPath)/flutter config --no-analytics

- task: Bash@3
displayName: '[Flutter] Build project environment'
inputs:
targetType: 'inline'
script: |
$(FlutterToolPath)/flutter pub get
$(FlutterToolPath)/flutter pub global activate junitreport

- task: Bash@3
displayName: '[Flutter] Flutter coverage'
inputs:
targetType: 'inline'
script: |
pip install lcov_cobertura
$(FlutterToolPath)/flutter test --coverage
python -m lcov_cobertura coverage/lcov.info -o coverage/coverage.xml

- task: Bash@3
displayName: '[Flutter] Flutter build'
inputs:
targetType: 'inline'
script: |
$(FlutterToolPath)/flutter build ios --release --no-codesign --build-number $(Build.BuildId)

- task: CocoaPods@0
inputs:
workingDirectory: '$(Build.SourcesDirectory)/ios/Flutter'
forceRepoUpdate: true

- task: Xcode@5
displayName: 'Xcode task'
inputs:
actions: 'build'
sdk: '$(sdk)'
configuration: '$(configuration)'
scheme: '$(scheme)'
xcWorkspacePath: ios/Runner.xcworkspace
signingOption: 'manual'
signingIdentity: $(APPLE_CERTIFICATE_SIGNING_IDENTITY)
provisioningProfileUuid: $(APPLE_PROV_PROFILE_UUID)
packageApp: true
workingDirectory: 'ios'
exportOptions: 'auto'
exportMethod: 'ad-hoc'
archivePath: 'output/$(sdk)/$(configuration)/Runner.xcarchive'
exportPath: 'output/$(sdk)/$(configuration)'
useXcpretty: 'false'
args: '-verbose'

- task: CopyFiles@2
displayName: 'Copy app to staging directory'
inputs:
Contents: '**/*.ipa'
TargetFolder: '$(build.artifactStagingDirectory)'
OverWrite: true

- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'

Existing Podfile found in directory

I fixed it by reloading the directory path. Running "cd /Users/x/Desktop/x" again, and then "pod init".



Related Topics



Leave a reply



Submit