Flutter Pod安装错误-“[!]哦,不,发生错误,”

pftdvrlh  于 2023-04-22  发布在  Flutter
关注(0)|答案(1)|浏览(95)

发生了什么?

当我想运行下面的代码时,我得到一个错误。

flutter clean
flutter pub get
cd ios
arch -x86_64 pod install //I have a m1 pro MacBook, so i have to add "arch -x86_64"

为什么我需要运行这个。
我正在将应用程序上传到Apple AppStore,但在构建过程中出现了问题。我需要删除Firebase Storage,反正我不使用它。这样做之后,我经常需要运行上面的代码。所以我这样做了。

我试过,但没有工作。

cd ~/.cocoapods/repos
rm -rf master
pod setup

sudo gem uninstall cocoapods
sudo gem install cocoapods
pod setup

这会对'trunk'中的所有内容给出'rm'的'permission denied'

rm -rf ~/.cocoapods/repos/trunk/

pod install

任何帮助将不胜感激。

终端错误输出

Analyzing dependencies
cloud_firestore: Using Firebase SDK version '10.3.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '10.3.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '10.3.0' defined in 'firebase_core'
Project at /Users/frederikalexanderbehrens/Documents/Wordoss/Runner.xcodeproj does not exist. Please check paths or incorporate Crashlytics upload symbols manually.
firebase_crashlytics: Using Firebase SDK version '10.3.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '10.3.0' defined in 'firebase_core'
Downloading dependencies
Installing AppAuth (1.6.0)

― ― ― Markdown模板― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ―

命令

/usr/local/Cellar/cocoapods/1.12.0/libexec/bin/pod install

报表

  • 你做了什么?
  • 你以为会发生什么?
  • 结果呢?

堆栈

CocoaPods : 1.12.0
        Ruby : ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin22]
    RubyGems : 3.4.10
        Host : macOS 13.1 (22C65)
       Xcode : 14.2 (14C18)
         Git : git version 2.37.3
Ruby lib dir : /usr/local/Cellar/ruby/3.2.2/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

插件

cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.1
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0

Podfile

# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

错误

Errno::EACCES - Permission denied @ rb_sysopen - /Users/frederikalexanderbehrens/Library/Caches/CocoaPods/Pods/VERSION
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/downloader/cache.rb:171:in `initialize'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/downloader/cache.rb:171:in `open'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/downloader/cache.rb:171:in `open'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/downloader/cache.rb:171:in `ensure_matching_version'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/downloader/cache.rb:22:in `initialize'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/downloader.rb:41:in `new'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/downloader.rb:41:in `download'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/pod_source_downloader.rb:69:in `download!'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/pod_source_installer.rb:117:in `download_source'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer/pod_source_installer.rb:67:in `install!'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:621:in `install_source_of_pod'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:539:in `block (2 levels) in install_pod_sources'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/user_interface.rb:86:in `titled_section'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:538:in `block in install_pod_sources'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:535:in `each'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:535:in `install_pod_sources'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:258:in `block in download_dependencies'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/user_interface.rb:64:in `section'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:257:in `download_dependencies'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/installer.rb:163:in `install!'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/command/install.rb:52:in `run'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/lib/cocoapods/command.rb:52:in `run'
/usr/local/Cellar/cocoapods/1.12.0/libexec/gems/cocoapods-1.12.0/bin/pod:55:in `<top (required)>'
/usr/local/Cellar/cocoapods/1.12.0/libexec/bin/pod:25:in `load'
/usr/local/Cellar/cocoapods/1.12.0/libexec/bin/pod:25:in `<main>'

― ― ―模板结束― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ― ―
[!]哦,不,发生错误。
搜索与您类似的现有GitHub问题:https://github.com/CocoaPods/CocoaPods/search?q=Permission+denied+%40+rb_sysopen+-+%2FUsers%2Ffrederikalexanderbehrens%2FLibrary%2FCaches%2FCocoaPods%2FPods%2FVERSION&type=Issues
如果不存在,请使用上面显示的模板在以下位置创建票证:https://github.com/CocoaPods/CocoaPods/issues/new
请务必首先阅读投稿指南,了解如何正确提交工单的详细信息:https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
不要忘记匿名化任何私人数据!
寻找cocoapods/cocoapods上的相关问题...未找到类似问题。要创建新问题,请访问:https://github.com/cocoapods/cocoapods/issues/new
[!]在目标Runner上自动为平台iOS分配版本12.0,因为未指定平台。请在Podfile中为此目标指定平台。请参阅https://guides.cocoapods.org/syntax/podfile.html#platform。frederikalexanderbehrens@Wordoss ios %

emeijp43

emeijp431#

我是如何成功的

在查找了许多不同的解决方案并花了几个小时之后,问题是我的许多文件都是“只读”的。所以pod install无法工作。

如果您遇到此问题,请尝试以下操作:(仅限Mac)

1.进入Flutter SDK文件夹。
1.在工具栏中单击文件,然后获取信息。
1.在“共享和权限”下,将您的用户标记为“读取和写入”。
1.在同一个窗口中,解锁右下角的锁。
1.点击它下面的下拉菜单,并说“应用于封闭的项目”。
你可能要为不同的文件夹重复。我也必须为我的ios文件夹重复。

相关问题