[英]How can I solve this “ Invalid `Podfile` ” error?
I'm new to ios development and I got a zip file from another developer for an ios project.我是 ios 开发的新手,我从另一位开发人员那里获得了 ios 项目的 zip 文件。 When I ran pod install, the terminal shows this error:当我运行 pod install 时,终端显示此错误:
[!] Invalid `Podfile` file: cannot load such file -- /Users/abc/Desktop/node_modules/@react-native-community/cli-platform-ios/native_modules.
# from /Users/abc/Desktop/ios/Podfile:2
# -----------------------------------------
# platform :ios, '9.0'
> require_relative '../node_modules/@react-
native-community/cli-platform-
ios/native_modules'
#
# -----------------------------------------
The directory is like this目录是这样的
~/Desktop/ios ~/桌面/ios
ls ls
GoogleService-Info.plist ISApp.xcodeproj
Podfile.lock
ISApp ISApp.xcworkspace
Pods
ISApp-tvOS ISAppTests
instrumentscli0.trace
ISApp-tvOSTests Podfile
I have looked at the thread below but it doesn't help at all.我已经查看了下面的线程,但它根本没有帮助。 Any input is appreciated.任何输入表示赞赏。
react-native ios Podfile issue with "use_native_modules!" react-native ios Podfile 问题与“use_native_modules!”
You need to provide the contents of your podfile.您需要提供 podfile 的内容。 Your podfile is probably not formatted correctly.您的 podfile 可能格式不正确。 If it is, one workaround could be to move your podfile to a different location, uninstall and reinstall cocoapods ( sudo gem uninstall cocoapods
and sudo gem install cocoapods
), initialize pod ( pod init
), copy the content of your podfile (making sure the formatting is not messed up) to the new podfile and then install pod again ( pod install
). If it is, one workaround could be to move your podfile to a different location, uninstall and reinstall cocoapods ( sudo gem uninstall cocoapods
and sudo gem install cocoapods
), initialize pod ( pod init
), copy the content of your podfile (making sure the格式化没有搞砸)到新的 podfile,然后再次安装 pod( pod install
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.