skip to Main Content

I have created Flutter Project. It’s working on Windows OS for Android Successfully. I have tried for the first time to run it in XCode (Mac OS) but getting some error as follows.

Running Xcode build…
Xcode build done. 14.3s
Failed to build iOS app Error output from Xcode build: ↳
** BUILD FAILED **

Xcode’s output: ↳
In file included from
/xxx/xxx/xxx/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Utilities/FIRAuthURLPresenter.m:24:
/xxx/xxx/xxx/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Utilities/FIRAuthDefaultUIDelegate.
h:18:24: error: ‘TARGET_OS_WATCHOS’ is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_] #if !TARGET_OS_OSX && !TARGET_OS_WATCHOS
^
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete

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

I have added error only for reference. If you need anything please do let me know.

2

Answers


  1. Maybe some of your files have illegal characters or syntax errors.

    remove extra line like

    #endif without if 
    

    it will work.

    Login or Signup to reply.
  2. If you are using Xcode 12.5, this issue could be solved by changing TARGET_OS_WATCHOS to TARGET_OS_WATCH

    You could also refer to this GitHub issue https://github.com/FirebaseExtended/flutterfire/issues/5034

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search