Flutter Xcode Build Failed - 'TARGET_OS_WATCHOS' is not defined, evaluates to 0

1,747

Solution 1

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

Solution 2

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

remove extra line like

#endif without if 

it will work.

Share:
1,747
Pratik Butani
Author by

Pratik Butani

Pratik Butani is Android/Flutter Lead at 7Span - Ahmedabad. He is working with Flutter Development since 2020 and Android Development since 2013. He is on the list of Top 100 User’s (85th) in India and Top 10 User’s (6th) in Gujarat as Highest Reputation Holder on StackOverflow. He was co-organizer at Google Developer Group – Rajkot in 2014-17. All-time Learner of new things, Googler and Eager to Help IT Peoples. He is also likes to share his knowledge of Android and Flutter with New Learner. SOReadyToHelp ツ Fell in Love with Android ツ I really feel proud to up-vote My Favorite #SO friend. => Android Application Developer by Passion :) => Being Helpful by Nature ;) => Now in List of Top 100 User's (85) in India and Top 10 User's (6) in Gujarat as Highest Reputation Holder on StackOverflow => Visit my blogs for learning new things : Happy to Help :) :) => My Apps on Playstore: AndroidButs & PratikButani => My Articles on Medium => Join Me on LinkedIn => Tweet Me on Twitter => Follow Me on Quora - Top Writer on Quora in 2017 => Hangout with Me on [email protected] => Social Networking Facebook => Get Users list whose bio's contains given keywords More about me :) -> Pratik Butani

Updated on December 27, 2022

Comments

  • Pratik Butani
    Pratik Butani over 1 year

    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.