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

时间:2020-01-26 19:35:08

标签: ios xcode debugging flutter ios-simulator

我的问题是由于某种原因我无法在iOS模拟器上开始调试。我已经尝试了几种解决方案,它们可能以他们的方式提供了帮助,但是问题并没有消失,我现在很绝望。我不知道该网站的工作原理或现有的解决方案,但是我找不到,我需要您的帮助。

错误在这里:

var movieFlavor = ['Love', 'War', 'True'];



var loveMovies = ['Titanic', 'Noel', 'Pearl Harbor',

]


var warMovies = ['PT-109', 'Firebase Gloria', 'Pearl Harbor',

]

var trueMovies = ['PT-109', 'Remember the Titians', 'Pearl Harbor',
]


function newRandomMovieFlavor() {
    var randomFlavor = Math.floor(Math.random() * (movieFlavor.length));
    document.getElementById('movieDisplay1').innerHTML = movieFlavor[randomFlavor];
}


function newRandomMovie() {
    var randomMovie = Math.floor(Math.random() * (movieFlavor.length * randomFlavor));
    document.getElementById('movieDisplay2').innerHTML = movieFlavor.length * randomFlavor[randomMovie];
}

我扑扑的医生在这里

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.


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

9 个答案:

答案 0 :(得分:12)

我的问题以这种方式解决了:

flutter clean

这删除了引起问题的任何混乱的配置。

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

flutter run

答案 1 :(得分:12)

为我工作:

rm ios/Podfile

然后升级您的软件包:

pub upgrade
pub run

并更新您的Podfile:

cd ios && pod update

然后清理并运行:

flutter clean && flutter run

我希望这会有所帮助:)

答案 2 :(得分:1)

根据您使用的旧 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

答案 3 :(得分:0)

这可能对您有帮助

flutter packages get
cd ios
pod update

然后尝试再次运行

答案 4 :(得分:0)

尝试从ios/Podfile中删除以下行,我是按照https://firebase.flutter.dev/docs/overview/#improve-ios-build-times中的建议添加的。

pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '6.26.0'

答案 5 :(得分:0)

此解决方案可能对您有所帮助,请检查导入,这对我来说是一个错误,我像这样更改了导入。

import 'auth/login/login_view.dart';

import 'package:slgt_mobile_app/auth/login/login_view.dart';

答案 6 :(得分:0)

我有时也有这个问题,如果你在android studios更改你的项目并转到下一个项目,我建议你关闭android studio和ios模拟器并重新启动项目。

答案 7 :(得分:0)

我导入包 'package:http/http.dart' 并收到此错误,当我删除此包依赖项时,此错误消失了。

答案 8 :(得分:0)

初学者:(在XCODE 12.0.1上测试)打开Xcode-->打开一个项目或文件-->进入flutter应用路径/ios目录-->打开-->跑步者并按照附加链接中的步骤

Command PhaseScriptExecution failed with a nonzero exit code while trying to add Flutter to iOS app

相关问题