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

ysa*_*n20 25 debugging xcode ios ios-simulator flutter

我的问题是由于某种原因我无法在 iOS 模拟器上开始调试。我已经尝试了几种解决方案,我猜它以他们的方式有所帮助,但问题并没有消失,我现在很绝望。我不知道这个网站究竟是如何运作的,或者是否有任何现有的解决方案,但问题是我找不到,我需要你的帮助。

错误在这里:

Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running Xcode build...
Xcode build done.                                           45,6s
Failed to build iOS app
Error output from Xcode build:
?
    ** BUILD FAILED **


Xcode's output:
?
    /Users/omerugurerden/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:155:24: error: no visible @interface for 'FIRQuery' declares the selector 'queryWhereField:arrayContainsAny:'
            query = [query queryWhereField:fieldName arrayContainsAny:value];
                     ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/omerugurerden/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:157:24: error: no visible @interface for 'FIRQuery' declares the selector 'queryWhereFieldPath:arrayContainsAny:'
            query = [query queryWhereFieldPath:fieldPath arrayContainsAny:value];
                     ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/omerugurerden/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:163:24: error: no visible @interface for 'FIRQuery' declares the selector 'queryWhereField:in:'
            query = [query queryWhereField:fieldName in:value];
                     ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/omerugurerden/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:165:24: error: no visible @interface for 'FIRQuery' declares the selector 'queryWhereFieldPath:in:'
            query = [query queryWhereFieldPath:fieldPath in:value];
                     ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/omerugurerden/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:764:16: warning: 'timestampsInSnapshotsEnabled' is deprecated [-Wdeprecated-declarations]
          settings.timestampsInSnapshotsEnabled = (bool)call.arguments[@"timestampsInSnapshotsEnabled"];
                   ^
    In module 'FirebaseFirestore' imported from /Users/omerugurerden/AndroidStudioProjects/faltana/ios/Pods/Headers/Public/Firebase/Firebase.h:31:
    /Users/omerugurerden/AndroidStudioProjects/faltana/ios/Pods/FirebaseFirestore/Firestore/Source/Public/FIRFirestoreSettings.h:69:20: note: 'timestampsInSnapshotsEnabled' has been explicitly marked deprecated here
        __attribute__((deprecated));
                       ^
    1 warning and 4 errors generated.
    note: Using new build system
    note: Planning build
    note: Constructing build description
    warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
    warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
    warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'in_app_purchase' from project 'Pods')
    warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'in_app_purchase' from project 'Pods')
    warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')

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


Run Code Online (Sandbox Code Playgroud)

我的颤振医生来了

[?] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57,
    locale tr-TR)
    • Flutter version 1.12.13+hotfix.5 at /Users/omerugurerden/Developer/flutter
    • Framework revision 27321ebbad (7 weeks ago), 2019-12-10 18:15:01 -0800
    • Engine revision 2994f7e1e6
    • Dart version 2.7.0

 
[?] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/omerugurerden/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[?] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.8.4

[?] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)

[?] Connected device (1 available)
    • iPhone 11 Pro Max • E8102A9F-0AC3-497D-8DB7-44F965E3E533 • ios •
      com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)

• No issues found!

Run Code Online (Sandbox Code Playgroud)

编辑:可能是因为我还没有开发者帐户吗?

小智 23

为我工作:

rm ios/Podfile
Run Code Online (Sandbox Code Playgroud)

然后升级你的软件包:

pub upgrade
pub run
Run Code Online (Sandbox Code Playgroud)

并更新您的 podfile:

cd ios && pod update
Run Code Online (Sandbox Code Playgroud)

然后清理并运行:

flutter clean && flutter run
Run Code Online (Sandbox Code Playgroud)

我希望这个能帮上忙 :)

  • “pub run”更改为“flutter pub get” (6认同)
  • 对我不起作用(m1)错误:无法为模拟器构建应用程序。 (4认同)

Sur*_*gch 17

我的问题是这样解决的:

flutter clean
Run Code Online (Sandbox Code Playgroud)

这删除了导致问题的任何混乱配置。

如果您从 VS Code 运行 Flutter 项目,您可能无法获得所有错误信息。如果你从命令行运行 Flutter,你会得到更多的错误日志:

flutter run
Run Code Online (Sandbox Code Playgroud)


Nit*_*tin 2

根据日志,您正在使用旧的cloud_firestore库 请使用cloud_firestore-0.13.0+1而不是cloud_firestore-0.12.11

需要启用 Xcode 开发者模式。通过打开 Xcode 一次并确认或从命令行运行sudo xcodebuild -license来确保 Xcode 许可协议已签署。欲了解更多详细信息,请参阅下面的链接

https://flutter.dev/docs/get-started/install/macos