【问题标题】:Could not run application on IOS, issue about pod in Flutter无法在 IOS 上运行应用程序,有关 Flutter 中 pod 的问题
【发布时间】:2021-05-22 20:48:05
【问题描述】:

好的,首先让我们从这个开始:当我放弃 project/ios 并尝试 pod install 时,它给了我这个错误:(我想让你知道,我已经修复了 pod关于The platform of the target Runner``)的问题

[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: ({repo-path}/ios/Flutter/Flutter.framework)

好的,我找到了一些解决方案来解决这个问题,但这些解决方案对我不起作用: 我尝试过的解决方案:

  • 删除project/ios/Flutter/Flutter.framework 并在尝试运行pod install 之后。 当我这样做时,在pod install 的第一次运行中它给了我这个输出:
Analyzing dependencies
cloud_firestore: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_storage: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
Downloading dependencies
Installing GoogleUtilities 7.2.0 (was 7.2.2)
Generating Pods project
Integrating client project
Pod installation complete! There are 10 dependencies from the Podfile and 28 total pods installed.

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`).

之后,当我想运行应用程序时它不起作用,所以卡在Running Xcode build...

当终止(停止调试)它并运行这些命令时:

cd ios
pod install

它再次给了我这个输出:(同样的问题)。

[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: ({repo-path}/ios/Flutter/Flutter.framework)

我已经尝试了越来越多的解决方案来解决这个问题,检查了所有关于 flutter-ios-pod 的 StackOverflow 问题,但是我从未找到任何可行的解决方案。

【问题讨论】:

标签: flutter cocoapods flutter-ios


【解决方案1】:

呵呵,终于解决了这个问题。我尝试了更多的解决方案来解决,我将在下面提到最有用的解决方案:

  • 删除ios/Podfile.lock 然后运行这些命令:
cd ios
pod install

如果它不起作用,那么如果你遇到这样的新问题:

[!] The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: ({repo-path}/ios/Flutter/Flutter.framework)

您应该尝试通过以下步骤修复它:

  • 删除ios/Flutter/Flutter.framework
  • cd ios
  • pod install

如果这些步骤不起作用,您应该重新安装 Flutter 并重试。 重新安装完flutter后,可以尝试直接运行项目,如果项目不能运行,可以重试解决方案。

另外,您可以创建一个新的 Flutter 项目,并确保它是否可以在 ios 上运行, 所以只需运行应用程序,如果它可以运行,您可以将 lib、资产、文件移动到这个新项目中,修复一些语法问题,然后尝试以下步骤:

flutter pub get
cd ios
pod install
cd ..
flutter run

如果您对我尝试解决此问题时发生的事情以及我如何解决它感兴趣,以下是我的步骤:

首先我尝试了这个:

  • 删除ios/Flutter/Flutter.framework
  • cd ios
  • pod install

但它不起作用, 然后我在谷歌上搜索更多,但我找不到任何工作问题。 所以然后我删除了颤振并重新安装,所以我重新安装了颤振, 然后我在我的项目中执行这些步骤:

flutter pub get
cd ios
pod install
cd ..
flutter run

【讨论】:

    猜你喜欢
    • 2021-01-22
    • 2020-08-14
    • 1970-01-01
    • 2022-01-03
    • 2020-03-16
    • 2019-05-02
    • 1970-01-01
    • 2019-08-07
    • 2021-06-07
    相关资源
    最近更新 更多