skip to Main Content

I am facing an issue with pod file as below while instlling POD in Xcode project

Invalid `Podfile` file: undefined method `exists?' for File:Class

I did try to update POD version with brew upgrade cocoapods and also followed below link

https://dev.to/retyui/fix-a-pod-install-error-undefined-method-exist-for-fileclass-react-native-24ke

But still no fix.

Please guide me what am I doing wrong here.

below is my POD file

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'


flutter_application_path = '../bmi_flutter'
    
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')

target 'MixedNativeApp' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
  install_all_flutter_pods(flutter_application_path)
  # Pods for MixedNativeApp

  target 'MixedNativeAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'MixedNativeAppUITests' do
    # Pods for testing
  end

end

2

Answers


  1. Chosen as BEST ANSWER

    Here is my solution for above problem (Posting if it could be helpful for devs in same situation)

    gem cleanup
    brew uninstall cocoapods
    sudo gem uninstall cocoapods
    sudo gem install cocoapods -v 1.10.0 -n /usr/local/bin   ***`add cocoapod version u want to install`***
    sudo gem install cocoapods-user-defined-build-types
    pod install --repo-update
    

    1. brew remove cocoapods

    2. Same problem on 2.8.0 stable with cocoapods 1.11.3. To resolve this switch cocoapods to 1.11.2 sudo gem install cocoapods -v 1.11.2. Remember to remove 1.11.3 version first.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search