xcode 无效的'Podfile'文件:未定义File:Class的方法“exists?"

njthzxwz  于 2023-03-13  发布在  其他
关注(0)|答案(1)|浏览(893)

bounty将在2天后过期。回答此问题可获得+100声望奖励。Ky -希望引起更多人关注此问题。

在Xcode项目中安装POD时,我遇到了以下pod文件问题

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

我没有尝试更新POD版本与brew upgrade cocoapods,也按照下面的链接
https://dev.to/retyui/fix-a-pod-install-error-undefined-method-exist-for-fileclass-react-native-24ke
但还是没办法。
请告诉我我做错了什么。
下面是我的POD文件

# 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
omtl5h9j

omtl5h9j1#

这是我对上述问题的解决方案(如果它可以帮助开发者在相同的情况下张贴)

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

相关问题