5

我正在构建一个颤动的应用程序,并且我在颤动中使用 Facebook 开发日志记录。我使用 flutter_facebook_login: ^3.0.0flutter_facebook_auth: ^3.3.2插件,这个插件在android中工作,但在ios中它给了我以下错误:

[!] CocoaPods could not find compatible versions for pod "FBSDKCoreKit":
  In Podfile:
    flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/ios`) was resolved to 2.0.0, which depends on
      FBSDKCoreKit (~> 9.1.0)

    flutter_facebook_login (from `.symlinks/plugins/flutter_facebook_login/ios`) was resolved to 0.0.1, which depends on
      FBSDKCoreKit (~> 5.5)

我的颤振医生 -v

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.4, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[!] Xcode - develop for iOS and macOS
    ! Xcode 12.0.0 out of date (12.0.1 is recommended).
      Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] Connected device (2 available)

! Doctor found issues in 1 category.
mac@PK-iMac BBT VIIBO % flutter doctor -v)
zsh: parse error near `)'
mac@PK-iMac BBT VIIBO % flutter doctor -v 
[✓] Flutter (Channel stable, 2.0.4, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-GB)
    • Flutter version 2.0.4 at /Users/mac/Development/flutter
    • Framework revision b1395592de (4 weeks ago), 2021-04-01 14:25:01 -0700
    • Engine revision 2dce47073a
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/mac/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0, Build version 12A7209
    ! Xcode 12.0.0 out of date (12.0.1 is recommended).
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] Connected device (2 available)
    • iPhone 11 Pro (mobile) • 47FC0E06-9F40-4F1E-8230-CC914F734D26 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
    • Chrome (web)           • chrome                               • web-javascript • Google Chrome 90.0.4430.93

! Doctor found issues in 1 category.

已经运行pod repo update但无法解决

那我现在该怎么办?

4

5 回答 5

9

要解决此问题,请按照以下步骤操作:

  1. flutter clean
  2. 运行rm -f ios/Podfile.lock(用于删除ios/Podfile.lock文件)
  3. cd ios并点击pod update(更新所有依赖项)
  4. flutter run
于 2021-04-27T13:32:17.663 回答
2

如果你有英特尔芯片

  1. 扑干净
  2. 将所有依赖项更新到 pubspec.yml 文件中的最新版本并执行“获取 pub”
  3. 转到您的 Podfile 并取消注释 #platform :ios, '9.0' 然后将版本更改为 10 platform :ios, '10.0' 或更高版本
  4. 通过终端转到 ios 文件夹并执行“pod repo update”
  5. “pod 更新”或“pod 安装”

如果你有 M1 芯片

  1. 扑干净
  2. 将所有依赖项更新到 pubspec.yml 文件中的最新版本并执行“获取 pub”
  3. 转到您的 Podfile 并取消注释 #platform :ios, '9.0' 然后将版本更改为 10 platform :ios, '10.0' 或更高版本
  4. 通过终端转到 ios 文件夹并执行“arch -x86_64 pod repo update”
  5. 'arch -x86_64 pod update' 或 'arch -x86_64 pod install'
于 2021-11-01T11:34:05.553 回答
1

如果您使用的是带有 M1(苹果硅)的 Macbook,您可以尝试:

arch -x86_64 pod install --repo-update
于 2021-10-29T13:13:47.930 回答
0

尝试这个

  1. flutter clean

  2. 您可以手动删除 podfile.lock 或在终端中使用此命令rm -f ios/Podfile.lock

  3. 运行flutter pub get否则你会得到这个错误

Invalid `Podfile` file: /Users/<YOUR HOME DIRECTORY>/Documents/----/-----/------/---/ios/Flutter/Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first.

  1. 然后导航到项目根目录中的/ios文件夹cd/iospod update

5.flutter run

PS 确保您的 podfile 具有正确的最小 iOS 部署目标,检查每个 pod 是否可以处理所需的 iOS 版本。

于 2021-11-01T09:01:10.610 回答
0

你可以试试这个

首先 Flutter clean 然后从 ios 文件夹中删除 .symlinks、Pods、Podfile.lock 和 Runner.xcworkspace。

然后运行 ​​pub get。

告诉我它是否有效。

于 2021-04-27T12:45:42.587 回答