Flutter iOS“ld:未找到 Flutter 框架”

问题描述 投票:0回答:3

我已经创建了示例项目并在两个平台上成功运行。 但我已经更新了 android studio,然后在 iOS 应用程序停止工作后。我无法运行 iOS 应用程序。这是我面对的日志。

    Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    ld: framework not found Flutter
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel
    note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/gRPC-C++/gRPCCertificates-Cpp.bundle'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/sqflite/sqflite.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/fluttertoast/fluttertoast.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/firebase_storage/firebase_storage.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/firebase_core/firebase_core.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/flutter_facebook_auth/flutter_facebook_auth.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/firebase_auth/firebase_auth.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/cloud_firestore/cloud_firestore.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/Pods_Runner.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/GoogleUtilities/GoogleUtilities.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/GoogleDataTransport/GoogleDataTransport.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/FirebaseStorage/FirebaseStorage.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/gRPC-C++/grpcpp.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/FirebaseCore/FirebaseCore.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/gRPC-Core/grpc.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/FirebaseFirestore/FirebaseFirestore.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/FirebaseAuth/FirebaseAuth.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/FBSDKCoreKit_Basics/FBSDKCoreKit_Basics.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/path_provider_ios/path_provider_ios.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/Toast/Toast.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/PromisesObjC/FBLPromises.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/shared_preferences_ios/shared_preferences_ios.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/nanopb/nanopb.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/image_picker/image_picker.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/abseil/absl.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/leveldb-library/leveldb.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/FMDB/FMDB.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/GTMSessionFetcher/GTMSessionFetcher.framework'

note: Removed stale file '/Users/Rushabh/Library/Developer/Xcode/DerivedData/Runner-gtohejelopxdkkgekzyeqtnfiwjz/Build/Products/Debug-iphonesimulator/BoringSSL-GRPC/openssl_grpc.framework'

/Users/Rushabh/Documents/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'FMDB' from project 'Pods')
/Users/Rushabh/Documents/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'Toast' from project 'Pods')
/Users/Rushabh/Documents/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'BoringSSL-GRPC' from project 'Pods')
/Users/Rushabh/Documents/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'abseil' from project 'Pods')
/Users/Rushabh/Documents/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'leveldb-library' from project 'Pods')
/Users/Rushabh/Documents/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'gRPC-Core' from project 'Pods')
/Users/Rushabh/Documents/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'gRPC-C++' from project 'Pods')
/Users/Rushabh/Documents/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'gRPC-C++-gRPCCertificates-Cpp' from project 'Pods')

无法为模拟器构建应用程序。 在 iPhone 11 上启动应用程序时出错。

我正在使用 android studio 的大黄蜂版本。 我试过

pod deintegrated
pod install
但还是不行。

提前致谢

android ios flutter build runtime-error
3个回答
4
投票

您需要根据您的 iOS 部署目标和 flutter SDK 版本升级包。

然后尝试以下步骤。

  1. 奔跑
    flutter clean
  2. 奔跑
    flutter pub get
  3. 删除 xcode 派生数据 - 检查此链接
  4. 从项目 iOS 文件夹中删除 Pods 文件夹。
  5. 从项目 iOS 文件夹中删除 Podfile.lock 文件。
  6. 删除 project.workspace 文件
  7. iOS平台再次运行

0
投票

也面临同样的问题,我做的是卸载flutter并重新安装它https://docs.flutter.dev/get-started/install


0
投票

重新安装 flutter 解决了我的问题。

我正在使用 fvm 并且有一个项目使用 flutter 3.3.4。 当我构建我的项目

fvm flutter build ios 

我得到:

Error (Xcode): Framework not found Flutter

Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

重装flutter后,项目构建无报错

fvm remove 3.3.4
fvm install 3.3.4
© www.soinside.com 2019 - 2024. All rights reserved.