简体   繁体   English

无法为 flutter 的模拟器构建应用程序

[英]Could not build application for the simulator for flutter

I have done every thing and changed the iOS version to 10 in the pod file but it is still getting the error.我已完成所有操作,并将 pod 文件中的 iOS 版本更改为 10,但它仍然出现错误。

base) Gopis-MacBook-Pro:studyhall gopichand$ flutter run
Launching lib/main.dart on iPhone 11 in debug mode...
 
Running pod install...                                              8.4s
Running Xcode build...                                                  
 └─Compiling, linking and signing...                         5.0s
Xcode build done.                                           16.4s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output: Xcode 的 output:

↳
    /Users/gopichand/Library/Developer/Xcode/DerivedData/Runner-akyazhjaclkrdsdykcdxdgdzdeof/Build/Intermediates
    .noindex/Runner.build/Debug-iphonesimulator/Runner.build/Script-FD4D52F9DFAD0D40F508D02D.sh: line 2:
    /Users/gopichand/Desktop/studyhall/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh:
    Permission denied
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    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 14.0.99. (in target 'GoogleUtilities' from project 'Pods')
    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 14.0.99. (in target 'abseil' from project 'Pods')
    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 14.0.99. (in target 'BoringSSL-GRPC' from project 'Pods')
    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 14.0.99. (in target 'leveldb-library' from project 'Pods')
    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 14.0.99. (in target 'nanopb' from project 'Pods')
    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 14.0.99. (in target 'Toast' from project 'Pods')
    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 14.0.99. (in target 'GTMSessionFetcher' from project 'Pods')
    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 14.0.99. (in target 'gRPC-C++-gRPCCertificates-Cpp' from
    project 'Pods')
    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 14.0.99. (in target 'GoogleDataTransport' from project
    'Pods')
    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 14.0.99. (in target 'fluttertoast' from project 'Pods')
    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 14.0.99. (in target 'FirebaseCoreDiagnostics' from project
    'Pods')
    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 14.0.99. (in target 'FirebaseCore' from project 'Pods')
    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 14.0.99. (in target 'FirebaseAuth' from project 'Pods')
    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 14.0.99. (in target 'gRPC-Core' from project 'Pods')
    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 14.0.99. (in target 'gRPC-C++' from project 'Pods')
    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 14.0.99. (in target 'FirebaseFirestore' from project 'Pods')
    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 14.0.99. (in target 'firebase_core' from project 'Pods')
    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 14.0.99. (in target 'cloud_firestore' from project 'Pods')
    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 14.0.99. (in target 'firebase_auth' from project 'Pods')
    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 14.0.99. (in target 'FirebaseCoreDiagnosticsInterop' from
    project 'Pods')
    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 14.0.99. (in target 'FirebaseAuthInterop' from project
    'Pods')
    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 14.0.99. (in target 'Flutter' from project 'Pods')
    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 14.0.99. (in target 'Firebase' from project 'Pods')

Could not build the application for the simulator.
Error launching application on iPhone 11.

This error can occur due to multiple reasons.由于多种原因,可能会发生此错误。

  • Firstly, it can occur due to some native error which can be found by building the app in Xcode using ⌘ + B .首先,它可能是由于某些本机错误而发生的,可以通过使用⌘ + B在 Xcode 中构建应用程序来发现。 If that's the case then you can solve the error and try building the app in the Xcode itself.如果是这种情况,那么您可以解决错误并尝试在 Xcode 本身中构建应用程序。 If it succeeds in the building process then your app will run from Simulator.如果它在构建过程中成功,那么您的应用程序将从模拟器运行。

  • Secondly, try to change the iOS version from Xcode if not done already.其次,尝试将 iOS 版本从 Xcode 更改为 iOS(如果尚未完成)。

  • Thirdly, it can occur due to some changes in the pods.第三,它可能是由于 pod 的一些变化而发生的。 To fix this follow the following steps:要解决此问题,请执行以下步骤:

    • rm ios/Podfile

    • flutter pub get to get packages. flutter pub get获取包裹。

    • Remove Pods folder from the ios folder in the directory.从目录中的 ios 文件夹中删除Pods文件夹。

    • cd ios then pod install cd ios然后pod install

    • flutter clean

    • Run the project.运行项目。 ( Press F5 if you are using VSCode ) (如果您使用的是 VSCode,请按F5

I hope this solves your issue.我希望这能解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM