问题描述
好吧,首先让我们从这个开始:当我放弃 project/ios
并尝试 pod install
时,它给了我这个错误:(我想让你知道,我已修复关于 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 问题,但我从未找到任何可行的解决方案。
解决方法
呵呵,我终于解决了这个问题。我尝试了更多的解决方案来解决,我将在下面提到最有用的解决方案:
- 删除
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上可以运行, 所以只需运行应用程序,如果它工作,你可以将库、资产、文件移动到这个新项目中,修复一些语法问题,然后尝试以下步骤:
flutter pub get
cd ios
pod install
cd ..
flutter run
如果您对我尝试修复此问题时发生的事情以及我如何修复它感兴趣,以下是我的步骤:
首先我尝试了这个:
- 删除
ios/Flutter/Flutter.framework
cd ios
pod install
但它不起作用, 然后我在谷歌上搜索了更多,但我找不到任何工作问题。 所以我删除了flutter并重新安装,所以我重新安装了flutter, 然后我在我的项目中执行这些步骤:
flutter pub get
cd ios
pod install
cd ..
flutter run