cli: [!] Invalid `Podfile` file: 767: unexpected token at ''. | Related Issue #448

Github I have already tried : #448

On Stackoverflow : https://stackoverflow.com/questions/59279777/react-native-pod-error-invalid-podfile-file-767-unexpected-token-at On Reddit : https://www.reddit.com/r/reactnative/comments/e935e0/react_native_invalid_podfile_file_767_unexpected/

Environment

System: OS: macOS 10.15 CPU: (4) x64 Intel® Core™ i5-4250U CPU @ 1.30GHz Memory: 30.63 MB / 4.00 GB Shell: 3.2.57 - /bin/sh Binaries: Node: 10.15.3 - /usr/local/bin/node Yarn: 1.19.2 - /usr/local/bin/yarn npm: 6.13.1 - /usr/local/bin/npm SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 IDEs: Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.5 => 0.61.5

Stack

   CocoaPods : 1.8.4
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
    RubyGems : 3.0.3
        Host : Mac OS X 10.15 (19A526h)
       Xcode : 11.2.1 (11B500)
         Git : git version 2.22.0
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : master - git - https://github.com/CocoaPods/Specs.git @ 22fb554cd53c99959f604d1ef7806e824f6cd368
               trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /usr/local/Cellar/cocoapods/1.8.4/libexec/bin/pod

Plugins

cocoapods-clean       : 0.0.1
cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.4.1
cocoapods-try         : 1.1.0

Podfile

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'quibik' do
  # Pods for quibik

  pod 'RNFBAuth', :path => "../node_modules/@react-native-firebase/auth"
  pod 'RNFBApp', :path => "../node_modules/@react-native-firebase/app"

  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'


  pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'

  target 'quibikTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'quibik-tvOS' do
  # Pods for quibik-tvOS

  target 'quibik-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Description

Screenshot 2019-12-11 at 14 03 37

➜ ios git:(master) ✗ pod install --verbose /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19/rbconfig.rb:229: warning: Insecure world writable dir /Users/jack/Desktop/root in PATH, mode 040777

[!] Invalid Podfile file: 767: unexpected token at ‘’.

from /Users/jack/Desktop/root/outonox/quibik/ios/Podfile:45

use_native_modules! end


/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:301:in rescue in block in from_ruby' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:295:in block in from_ruby’ /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:50:in instance_eval' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:50:in initialize’ /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:293:in new' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:293:in from_ruby’ /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/podfile.rb:259:in from_file' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/config.rb:200:in podfile’ /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:150:in verify_podfile_exists!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command/install.rb:46:in run’ /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in run' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in run’ /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:55:in <top (required)>' /usr/local/bin/pod:23:in load’ /usr/local/bin/pod:23:in `<main>’

Reproducible Demo

Not sure why this is happing, but this is started after installing “@react-native-firebase” this package

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 9
  • Comments: 50 (3 by maintainers)

Most upvoted comments

I removed my node_modules, Pods, and Podfile.lock, then re-ran yarn and pod install and it worked again ¯_(ツ)_/¯

For me it was because I was using the terminal within vscode and the auto attach was breaking things, I changed my vscode settings to ignore the ios pods folder which seemed to work, disabling auto attach also works of course, my auto attach settings in my settings.json file ended up looking like this

  "debug.javascript.autoAttachSmartPattern": [
      "${workspaceFolder}/**",
      "!**/node_modules/**",
      "**/$KNOWN_TOOLS$/**",
      "!**/ios/Pods/**"
    ],

Had the same problem and then fixed by running npm uninstall react-native-cli

image

I had the same problem and finally found out that when I modified the AndroidManifest.xml file, I commented out some nodes which caused the execution of the ‘pod instgall’ command error.

  1. The issue here is that use_native_modules! hides the real issue.
  2. In my case it was missing import in react-native.config.js.

My issue was that I had react-native-cli as a dependency, Everything worked fine once I removed it and the error didn’t show up again. Hope somebody might find this useful.

For me it was fixed when I added the package property to the AndroidManifest.xml. Somehow it got removed by the auto updater from 0.70.6 to 0.72.3

AndroidManifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.YOURAPPNAME">

Following the upgrade to version 0.73.3, my colleague encountered an error message while using npx pod-install. The error message was unexpected token at '', but no further details were available. After running pod install in the ios folder, I received an error message indicating that NodeJS 16.x was being used. The error was resolved after switching to version 18.x. I hope this helps!

In my case, I’ve deleted react-native-config.js and the error disappeared.

  1. The issue here is that use_native_modules! hides the real issue.
  2. In my case it was missing import in react-native.config.js.

@rafales Would you be so kind as elaborate on what you exactly did to fix this error? What should I write into react-native.config.js?

I had the same problem in Azure Devops Pipeline, I upgraded node to the latest version and that solved my problem.

I simply forgot the run npm install before pod install.

I had this issue because i removed some dependencies from my package.json and the react-native-config.js file was still referring to those dependencies. I remove them from the .js file and I was able to pod install again.

i try lot to reproduces but i don’t know how this is happening… finally i have created new project and migrating things in that one by one… 😦

Had the same issue. Here is what helped me:

rm -rf package-lock.json ./node_modules && cd ios && rm -rf Podfile.lock Pods && cd ../ && yarn && cd ios; pod deintegrate; pod install; cd ../

This worked after I used global uninstall: npm uninstall -g react-native-cli

For me it was fixes when I added the package property to the AndroidManifest.xml. Somehow it got removed by the auto updater from 0.70.6 to 0.72.3

AndroidManifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.YOURAPPNAME">

You are a life saver, thank you man.

None of the above methods worked for me. I had this error caused by an old NODE_EXTRA_CA_CERTS environment variable I had sitting around. What worked was running: unset NODE_EXTRA_CA_CERTS

@raphaelrk this worked out! Thanks!