【问题标题】:React Native Pod Error - [!] Invalid `Podfile` file: 767: unexpected token at ''. | Related Issue #448React Native Pod 错误 - [!] 无效的 `Podfile` 文件:767: '' 处的意外令牌。 |相关问题 #448
【发布时间】:2020-04-04 09:07:51
【问题描述】:

我已经试过了:#448

环境

System:
OS: macOS 10.15
CPU: (4) x64 Intel(R) Core(TM) 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

说明

➜ 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 `

' 可重现的演示

不知道为什么会这样,但这是在安装“@react-native-firebase”这个包后开始的

POD 文件

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

target 'quibik' do # 用于 quibik 的 Pods

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”吊舱 'FBReactNativeSpec', :path => “../node_modules/react-native/Libraries/FBReactNativeSpec”吊舱 'RCTRequired', :path => “../node_modules/react-native/Libraries/RCTRequired”吊舱 'RCTTypeSafety',:路径 => "../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' 吊舱 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' 吊舱 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' 吊舱 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' 吊舱 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' 吊舱 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' 吊舱 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' 吊舱 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' 吊舱 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' 吊舱 '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' 吊舱 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' 吊舱 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' 吊舱 'ReactCommon/jscallinvoker', :path => “../node_modules/react-native/ReactCommon”吊舱 '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' 吊舱 '愚蠢',:podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

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

目标 'quibikTests' 做 继承! :search_paths # 用于测试的 Pod 结束

使用_native_modules!结束

target 'quibik-tvOS' do # 用于 quibik-tvOS 的 Pods

target 'quibik-tvOSTests' 做 继承! :search_paths # 用于测试的 Pod 结束

结束

【问题讨论】:

  • 你能把你的Podfile贴在这里吗?
  • 感谢您的及时回复...我在 Github 中添加了 pod 文件。 github.com/react-native-community/cli/issues/885
  • 看看:stackoverflow.com/a/57239476/2638849。也许你的解决方案在那里
  • 我被这个确切的错误困住了大约 2 天,它是在安装 rvm 后开始的,所以至少在我的情况下,它似乎是 ruby​​ 版本的问题。我遇到了版本 2.6.3 和默认 mac 版本 2.3.7 的问题。清理 rvm 安装并重新安装后问题停止。我注意到该文件在运行 rvm 且默认使用 ruby​​ 2.5.3 和 cocoapods 1.8.4 的同事机器上运行良好,在重新安装 rvm 并模拟此环境后,该文件再次在我的机器上运行。希望对您有所帮助。
  • 我找不到解决方案,所以我不得不将我的代码移动到一个新的解决方案。

标签: react-native cocoapods react-native-ios react-native-cli


【解决方案1】:

您的项目包含由 Yarn 以外的工具生成的锁定文件。建议不要混用包管理器,以免锁文件不同步导致解析不一致。要清除此警告,请删除 package-lock.json。

rm -rf package-lock.json
cd ios
pod install

【讨论】:

  • 这个问题已经解决,您的回答几乎是正确的。我会接受的。
猜你喜欢
  • 2022-10-14
  • 2020-09-12
  • 1970-01-01
  • 2018-01-25
  • 1970-01-01
  • 2022-11-05
  • 1970-01-01
  • 2018-09-13
  • 2017-07-28
相关资源
最近更新 更多