user13809035
user13809035

Reputation: 11

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. When I ran pod install, the terminal shows this error:

[!] 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
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!"

Upvotes: 0

Views: 10486

Answers (1)

Ehsan Misaghi
Ehsan Misaghi

Reputation: 76

You need to provide the contents of your podfile. Your podfile is probably not formatted correctly. 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).

Upvotes: 1

Related Questions