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

17

51

My problem is I cannot start debugging on iOS simulator for some reason. I have tried several solutions it helped in their ways I guess but the problem is not gone and I am desperate now. I don't know how exactly is this site works or is there any existing solution, but thing is I couldn't find and I need your help.

Error is here:

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.


and my flutter doctor is here

[✓] 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!

Edit: Can it be because of I don't have developer account yet?

Carranza answered 26/1, 2020 at 19:35 Comment(4)
have you tried to run flutter clean?Latty
yes I have but didn't workCarranza
The error is happening at compile time. Update Firestore, cloud_firestore 0.13.0+1. Pretty sure FIRQuery is deprecated anywhoSusumu
@Susumu updated but didn't worked :(Carranza
S
70

Worked for me:

rm ios/Podfile

Then upgrade your packages:

flutter pub upgrade
flutter pub get

And update your podfile:

cd ios && pod update

Then clean and run:

flutter clean && flutter run

I hope this will help :)

Supination answered 30/7, 2020 at 9:34 Comment(6)
Thank you. Following these steps I was able to run my app on iOS simulator.Sierrasiesser
'pub run' change to 'flutter pub get'Plunger
Thanks this worked great; I added flutter prefix for pub.Faltboat
Did not work for me (m1) error: Could not build the application for the simulator.Tenpins
In my case, 'flutter pub upgrade' was enough.Astraea
didn't work for m1Jello
S
26

My problem was solved in this way:

flutter clean

That deleted whatever messed up configuration was causing the problem.

If you are running the Flutter project from VS Code you may not be getting all of the error information. You get more error logs if you run Flutter from the command line:

flutter run
Sapele answered 15/7, 2020 at 5:32 Comment(0)
F
3

I've been having this problem a lot as well on my Mac M1. Initially it builds and runs fine but as soon as you start adding packages this error starts happening. I tried Olle Kyrychenko solution above and it didn't work until I opened the project in Xcode, went to runner -> Info -> Configurations and changed the debug from Pods.debug to Debug (the first dropdown called runner i left as none, the second dropdown with a target I changed to debug). I did the same for release.

See Image ->

Xcode config setup

I would follow Olle Kyrychenko's solution above first though

Force answered 15/10, 2021 at 6:51 Comment(0)
S
2

As per the logs you are using old cloud_firestore library Please use cloud_firestore-0.13.0+1 instead of cloud_firestore-0.12.11

Needs to enable Xcode developer mode. Make sure the Xcode license agreement is signed by either opening Xcode once and confirming or running sudo xcodebuild -license from the command line. For more details refer below link

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

Stroup answered 28/1, 2020 at 12:11 Comment(0)
L
1

This might help you,

flutter packages get
cd ios
pod update

then try to run again

Larvicide answered 5/6, 2020 at 8:35 Comment(0)
R
1

After investigating quite a while, I found out about running flutter with the -v option (flutter run -v).

Initially I was playing around with custom icons in my app and then suddenly stumbled upon the error mentioned above. The problem was that I had structured my assets as /assets/icons/Icon.tff and forgot the assets path infront of my asset declaration:

Before:

fonts:
    - family: MyFlutterApp
      fonts:
        - asset: icons/MyFlutterApp.ttf

After:

fonts:
    - family: MyFlutterApp
      fonts:
        - asset: assets/icons/MyFlutterApp.ttf

I hope I can help someone not to waste so much time on this error as I did :D

Raffle answered 9/2, 2022 at 16:44 Comment(0)
Z
0

Try removing the following line from ios/Podfile, which I added by following the suggestion in 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'
Zinn answered 13/9, 2020 at 3:47 Comment(0)
O
0

If none of the answers work, simply check for your imported packages

Be sure that you don't have import 'dart:html';

this dart:html has been imported by accident and when I removed it works for me

Happy Codding :)

Outstretched answered 1/6, 2024 at 12:12 Comment(0)
W
-1

This solution may help you, Please check the imports, it's an error for me I changed my import like this.

import 'auth/login/login_view.dart';

to

import 'package:slgt_mobile_app/auth/login/login_view.dart';
Wheat answered 8/4, 2021 at 4:48 Comment(0)
E
-1

I also had this problem sometimes, It happens if u change your project in android studios and go to the next Project, I recommend u close android studio and ios simulator and start the project again.

E answered 31/5, 2021 at 13:28 Comment(1)
File -> Invalidate Caches and restart would also a good suggestionLeavitt
C
-1

I import package 'package:http/http.dart' and get this error, when I removed this package dependency, this error gone.

Cuba answered 21/6, 2021 at 7:13 Comment(0)
O
-1

enter image description here

I deleted this configuration item, success!

Overreact answered 27/10, 2021 at 6:20 Comment(0)
Z
-1

I found a simple solution . just in case save backup :)

  1. rm -rf ios // remove ios folder
  2. flutter create -i swift . // recreate ios folder

That's it.

Zenithal answered 6/8, 2022 at 1:28 Comment(0)
W
-1

I hope to help you solve the problem.

WHY DID I GET THIS PROBLEM - I edited some default file in the SDK and it started to give me this error.

SOLUTION - I eliminated the folder with the SDK and unzipped again from the flutter website. So I briefly to reinstalled the SDK.

Weiner answered 24/12, 2022 at 12:36 Comment(0)
B
-1

What I found is package(s) in my pubspec.yaml file are not updated to the latest Xcode.

My solution was to install the previous version of XCode and add it to my 'Applications' folders as something like "Xcode14.2"

Launch either Xcode then navigate to "Xcode -> Settings" Select the "Locations" tab -> Tap "Command Line Tools:" Selected the previous version (in my case "Xcode14.2") from the drop down.

Should work now.

EXTRA: To find which package(s) are not updated, open the Runner.xcworkspace in your flutter projects iOS folder and try to run the program from XCode. I get the name of the package that caused the error. Then you can:

  • contact the developer
  • find another package
  • fork the existing one.
  • make your own {Swift anyone}

SEO: File not found libarclite_iphonesimulator.a

Bullfight answered 2/4, 2023 at 22:11 Comment(1)
The issue with "libarclite_iphonesimulator.a" is covered by Can't run Flutter app on simulator after upgrading XCode to 14.3 because of missing libarclite_iphonesimulator.a filePhotoreceptor
S
-1

This steps worked for me:

In the terminal write this:

rm ios/Podfile

Now we need to upgrade:

flutter pub upgrade

flutter pub get

cd ios && pod update

Then:

flutter clean && flutter run

I hope this help anyone faced this problem.

Schindler answered 2/9, 2023 at 9:28 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Kela
G
-1

Delete .dart_tool directory, then:

flutter pub get
flutter run
Glottalized answered 20/10, 2023 at 14:42 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.