iOS 接入Flutter报错 Invalid `Podfile` file: cannot load such file -- /Users/sdr/AndroidStudioProjects...

我们是依照flutter官方文档接入的
  1. Add the following lines to your Podfile:

    content_copy

    flutter_application_path = '../my_flutter'
    load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
    
    
  2. For each Podfile target that needs to embed Flutter, call install_all_flutter_pods(flutter_application_path).

    content_copy

    target 'MyApp' do
      install_all_flutter_pods(flutter_application_path)
    end
    
    
  3. Run pod install.
    咿呀报错了

    image.png

pod之后报错
[!] Invalid `Podfile` file: cannot load such file -- /Users/sun/AndroidStudioProjects/flutter_app/.ios/Flutter/podhelper.rb.
解决方案

解决方法:

1、首先进入到flutter的文件下:输入flutter clean。

2、执行完成后输入:flutter pub upgrade。

3、最后回到项目中重写pod install一下就可以了。

你可能感兴趣的:(iOS 接入Flutter报错 Invalid `Podfile` file: cannot load such file -- /Users/sdr/AndroidStudioProjects...)