我正在使用cocoapods 1.7.5,执行pod install
时遇到此错误:
[!] Invalid `Podfile` file: undefined method `+' for nil:NilClass.
# from /Users/yuhan/jiemian_project/iOS_MoerFinance/A-源代码/MoerFinance/Podfile:71
# -------------------------------------------
# location = flutter_podhelper.index(post_install_string)
> location += post_install_string.length
#
# -------------------------------------------
以前有人遇到过同样的问题吗?我不知道为什么flutter_podhelper.index(post_install_string)
返回nil,我可以在目录中找到podhelper
。在另一台计算机上,pod install
是成功的,但是在这台计算机上,显示上面的错误。
podfile一些代码
def multiple_post_install(flutter_application_path)
#read podhelper from flutter_application_path
flutter_podhelper = File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb'))
#find the post_install end location by hardcoding
post_install_string = 'post_install do |installer|'
location = flutter_podhelper.index(post_install_string)
location += post_install_string.length
答案 0 :(得分:0)
尝试使用它。它将解决此问题
1-升级抖动(确保始终指向主通道,否则请切换到主通道) 2-更新cocoapods 3-扑干净 4- rm -RF iOS / Pod 5- rm -Rf ios / .symlinks 6- rm -RF iOS / Flutter / Flutter.framework 7- rm -Rf ios / Flutter / Flutter.podspec
再次构建并检查