gpt4 book ai didi

flutter 给出错误 "Error running pod install"

转载 作者:行者123 更新时间:2023-12-05 08:29:22 25 4
gpt4 key购买 nike

当我对我的 flutter 应用程序实现 google_sign_in 包时,我收到以下错误/日志。我正在使用 m1 芯片。所有软件包、flutter 框架和最新版本的 xcode。

Flutter 项目依赖:

  • http: ^0.13.4
  • firebase_auth:^3.3.6
  • google_sign_in:^5.2.3

起初我得到这个:



Error output from CocoaPods:

[!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

然后我在 ios/Podfile 上取消注释这个 platform :ios, '9.0'

但不同的错误显示如下:



Launching lib/main.dart on iPhone 13 in debug mode...
lib/main.dart:1
CocoaPods' output:

Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Fetching external sources
-> Fetching podspec for `Flutter` from `Flutter`
-> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
firebase_auth: Using Firebase SDK version '8.11.0' defined in 'firebase_core'
-> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
firebase_core: Using Firebase SDK version '8.11.0' defined in 'firebase_core'
-> Fetching podspec for `google_sign_in` from `.symlinks/plugins/google_sign_in/ios`
Resolving dependencies of `Podfile`
Error output from CocoaPods:

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle' **(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))**, '/usr/lib/ffi_c.bundle' (no such file) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi_c.bundle (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi.rb:5:in `rescue in '
from /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/lib/ffi.rb:2:in `'
2
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon.rb:3:in `'
2
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `'
2
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
...

我认为是因为我使用的 m1 芯片,根据此错误消息 (mach-o 文件,但它是一个不兼容的架构(有 'arm64',需要 'x86_64'))有人知道这个问题吗?

此外,以下主题的答案对我不起作用。

Flutter Error running pod install After Upgrading Flutter version

Flutter pod install issue and ios app not running

https://github.com/CocoaPods/CocoaPods/issues/10127#issuecomment-705741320

最佳答案

在您的项目文件中使用这些命令来手动安装 pod 文件:

  1. >

    cd ios

  2. >

    arch -x86_64 pod install

  3. >

    cd ..

  4. >

    flutter run

关于 flutter 给出错误 "Error running pod install",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71002380/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com