133

I just upgraded to Xcode 13.3-beta, running a flutter project got this error:

Error output from Xcode build:
↳
    2022-03-02 17:45:38.148 xcodebuild[62848:6695836] Requested but did not find extension point with identifier
    Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in
    com.apple.dt.IDEWatchSupportCore
    2022-03-02 17:45:38.148 xcodebuild[62848:6695836] Requested but did not find extension point with identifier
    Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of
    plug-in com.apple.dt.IDEWatchSupportCore
    ** BUILD FAILED **

Now, I am confused, I am running a iOS app on simulator, why throughs out errors like watchOS?

And I totally don't know how to resolve this error.

Any one could help me?

Nicholas Jela
  • 2,540
  • 7
  • 24
  • 40
  • 3
    no, I found this error happens casually on simulator, real phone doesn't have this problem. – Nicholas Jela Mar 15 '22 at 02:15
  • 1
    I'm seeing the same error. The same code built yesterday. I only pulled a commit with a url change. I get this when trying to build a release ipa and archive it. – Joel Broström Mar 15 '22 at 10:59
  • 2
    I upgraded Xcode to 13.3 this morning, and I got the same error, but it appeared when I tried to configure the C compiler in MATLAB. I am not a macOS/iOS/watchOS developer, so this error confused me a lot. – Huihui Li Mar 15 '22 at 13:13
  • upgraded to macOS 12.4, and then there was some update for Xcode, did that too, then it's gone. – Tushar Asodariya May 17 '22 at 16:13
  • 1
    Oddly enough, I'm getting this error when SSHing to the Mac but not when doing `flutter run` directly in a Terminal in the Mac – simplegamer Jun 07 '22 at 05:21
  • I found a simple solution. https://stackoverflow.com/questions/64973346/error-flutter-flutter-h-file-not-found-when-flutter-run-on-ios/73256598#73256598 – dokind Aug 06 '22 at 01:38

43 Answers43

67

OK, very weird but running xcrun multiple times seems to fix this. I had also updated to Xcode 13.3 recently.

xcrun -sdk iphoneos --show-sdk-path

The first time it shows the error. The second time it shows the right answer. I ran it with all three sdks, iphoneos, macosx, watchos and all showed the errors the first time. I also ran it with all five of the options for all three sdks:

xcrun -sdk iphoneos --show-sdk-path
xcrun -sdk iphoneos --show-sdk-version
xcrun -sdk iphoneos --show-sdk-build-version
xcrun -sdk iphoneos --show-sdk-platform-path
xcrun -sdk iphoneos --show-sdk-platform-version

The build error from xcodebuild went away after that, although I'm not certain which of the commands fixed it.

PhoneyDeveloper
  • 1,100
  • 7
  • 7
  • afte this command I had this message on flutter run iOS Updating project for Xcode compatibility. Upgrading project.pbxproj Upgrading Runner.xcscheme – Francesco Vezzani Apr 07 '22 at 20:41
  • **I've tried most solutions**, Nothing worked for me, Until I **upgraded from Flutter 3.0.3 to 3.0.4**. Then run `flutter build ios` !! – Mod Jul 05 '22 at 05:01
  • 1
    I am on Flutter 3.0.5 and nothing of these helps :( – Csutkas Jul 24 '22 at 19:36
  • 2
    Fixed it for me. To run this for all sdks I used: `xcodebuild -showsdks | grep -oe "-sdk .*" | awk '{print $2}' | xargs -S 1000 -n 1 -R '-1' -I % sh -c 'xcrun --sdk % --show-sdk-path --show-sdk-path && xcrun --sdk % --show-sdk-version && xcrun --sdk % --show-sdk-build-version && xcrun --sdk % --show-sdk-platform-path && xcrun --sdk % --show-sdk-platform-version'` – Jonas Aug 17 '22 at 17:03
  • @Jonas solution worked perfectly for me using flutter v3.0.5. Thanks! – Lee Mordell Nov 04 '22 at 21:27
28

Fixed this by running.

xcrun -sdk macosx --show-sdk-path 

This outputs your current skd path.

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk

Add this to your .zshrc file.

export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk

Source it

source ~/.zshrc

Now run

 xcrun -sdk macosx --show-sdk-version
user1503606
  • 3,872
  • 13
  • 44
  • 78
23

To avoid hard coding the version you can add this to your .profile:

export SDKROOT=$(xcrun -sdk macosx --show-sdk-path)

reload profile (source path to your profile) and run

xcrun -sdk macosx --show-sdk-version

to verify

naile
  • 431
  • 2
  • 5
18

Found solution:

  1. Check for updates of Xcode in App Store (it should be updated already, but just for confirmation)
  2. Launch Xcode; it will ask you to install additional software. After installation finishes the errors will gone.
shim
  • 9,289
  • 12
  • 69
  • 108
Steelbow
  • 181
  • 3
  • I have tried everything there is on this forum page... and nothing works !!! I started getting this error when updating to XCODE 13.3. Now I can't build app at all. What can I do ??? – SylvainJack Apr 15 '22 at 09:17
13

If it's a flutter project following step can be helpful:

  • Update MacOS
  • Update Xcode and command lines tools
  • Run flutter pub upgrade, flutter pub get in the project folder
  • Delete podfile.lock in ios folder of the project
  • Run cd ios, pod repo update, pod install in the project folder
alegos27
  • 204
  • 2
  • 3
10

This is problem from xcode when xcode select doesn't link with CommandLineTools run below command for link it

// reset to the default command line tools path
xcode-select -r

// Link xcode-select with CommandLineTools
sudo xcode-select -s /Library/Developer/CommandLineTools

If that not working. Maybe problem from the keychain is not unlock.

You need to unlock that by

security unlock-keychain

Or with password

security unlock-keychain -p <password>

Hope this way can help you, thanks.

tuanngocptn
  • 1,241
  • 13
  • 21
  • xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools/' – Mahmoud Hadad Nov 05 '22 at 11:26
  • 1
    @MahmoudHadad: maybe your devices has not install command line tool you can check this question for install it https://stackoverflow.com/q/9329243/5558052 – tuanngocptn Nov 07 '22 at 06:38
6

This issue is sadly with XCode 13.3.

This is pointed out by this answer - Stackoverflow Answer- Flutter for iOS run, build but not archive

The three solutions given were

  • Modify the code

  • Downgrade to Xcode 13.2.1

  • Wait for Apple to modify Xcode

For myself I use CodeMagic, and didn't have the luxury of downgrading my Archive. XCode could take months to update. So modifying the code was the only option. I was able to find this issue opened on March 15th 2022. Which eventually has this solution..

Open your Podfile and paste pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git' as shown below:

`target 'Runner' do
use_frameworks!
use_modular_headers!
#Workaround for segmentation fault:11 while archiving
#Add the below line
pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git'

flutter_install_all_ios_pods File.dirname(File.realpath(FILE))
end`

Yes I know your error said your errors were through WatchOS. However as I understand, this is an issue that occurs in version 13.3 of Xcode. In Xcode 13.3, if you have a code that uses UI_USER_INTERFACE_IDIOM(), you will get an "Out of Memory" error when you run Archive. Changing "UI_USER_INTERFACE_IDIOM()" to "UIDevice.current.userInterfaceIdiom" resolves the error. Commonly this issue occures with flutter pods using - DKImagePickerController/PhotoGallery.

I was able to fix this without touching anything Watch related. On top of this I made sure my flutter project had a minimum support level of 12, however that might be completely unrelated.

Ultimately downgrading is probably the solution. As well many of my links lead to other solutions if anyone is curious of the diving into it.

C. Skjerdal
  • 2,750
  • 3
  • 25
  • 50
6

There is an error in file /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEWatchSupportCore.ideplugin/Contents/Resources/IDEWatchSupportCore.xcplugindata

You should make its backup, then open it in plist editor and fully remove the following items:

  • Root/plug-in/extensions/Xcode.DebuggerFoundation.AppExtensionHosts.watchOS
  • Root/plug-in/extensions/Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS
John Govage
  • 139
  • 1
  • 3
  • 3
  • This is indeed the one true solution. Note one can also edit this PLIST file with Xcode itself by first making a copy of the file, making the copy owned/writeable by one's normal userid, opening it with `open` or the finder, then copying the modified file back to its original location (as the superuser). (It should also be possible to fix it with `plutil`, but I was unable to find the correct way to express the keypath.) – Greg A. Woods Jul 14 '22 at 21:24
4

A workaround that worked for me was to install the previous stable Xcode version 13.2.1 and build it from the IDE.

You can have multiple versions installed, so you don't have to change anything in your current setup.

https://xcodereleases.com/

shim
  • 9,289
  • 12
  • 69
  • 108
Joel Broström
  • 3,530
  • 1
  • 34
  • 61
4

Check if there is some update for Xcode.

xcode-select --install

If you get the message below from the command above, try:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

  sudo rm -rf /Library/Developer/CommandLineTools
  xcode-select --install

Also, you should check if there is a macOS update available.

Click on the Apple icon no top left > About this mac > Software update (for example, macOS Monterey 12.3)

Cícero Moura
  • 2,027
  • 1
  • 24
  • 36
4

Got this as well when trying to run the app from Android Studio. Solved this by...

  • starting XCode,
  • open the Runner,
  • run the app from xcode,
  • stop the app in xcode, ...and then it worked fine to run the app without this error from Android Studio.
4

I faced the same problem when updating the project with Flutter 3. After several attempts, the below solution worked for me.

I have deleted the podfile.lock file inside the ios folder and then run the below commands.

  1. flutter pub upgrade
  2. flutter pub get
  3. cd ios
  4. pod repo update > Actually, this was an error for me but ignored it
  5. pod install

Also please make sure you are using the latest MacOS and Xcode. I hope this will help someone else.

Alex Chengalan
  • 8,211
  • 4
  • 42
  • 56
3

In my case, its React Native app, the problem was with cocoa pods. Reinstalling pods helped. Run below in your project folder

rm -rf ios/Pods && npx pod-install
  • 3
    This error is not caused by cocoapods. It is an output of `xcodebuild`. – Daumantas Versockas Mar 16 '22 at 11:29
  • @DaumantasVersockas in my case it was also output of xcodebuild and it was caused by cocoapods needed reinstalling after xcode update – romanzpolski Mar 16 '22 at 17:14
  • As far as I understand issue might caused by upgraded build system, which uses different names for binary targets. In case you have updated versions, that already patvhed this issue, it makes sense. – Daumantas Versockas Mar 16 '22 at 17:18
3

Okay, just found a solution which might sound super dumb but updating my Mac OS to Moterey 12.3 solved the issue with no change in the code required.

Javad Moradi
  • 866
  • 7
  • 18
2

I had the same issue , and i could solve it by removing the image picker newer package manually from the package folder and set the image picker package version to image_picker: 0.8.4 , and this solved the issue , hope it can help , maybe if you can share all the error message then i can help you .

Peter aziz
  • 131
  • 1
  • 1
  • 8
1
  1. you can try install the latest xcode13.3
  2. then you can try xcode-select --install to install the command tools
uwei
  • 127
  • 6
1

Run command sudo xcode-select -s /Applications/Xcode.app

fananek
  • 48
  • 4
1

Works with xcode 13.3.1, Monterey intel: downgrade flutter sdk to Flutter ->2.10.0 Dart ->2.16.0

which can be downloaded here: https://docs.flutter.dev/development/tools/sdk/releases?tab=macos

change your valid sdk path in terminal with flutter --version

this includes for new projects.

running May 1, 2022

jmoerdyk
  • 5,544
  • 7
  • 38
  • 49
1

This solution worked for me

  • Try xcode-select --install If command line developer tools were already installed try fixing it by
  • sudo xcode-select -r
1

Finally, I found solution, hope this helpul for you.

Change flutter channel from stable to master

code@kazus-MacBook-Air ios %flutter channel master
code@kazus-MacBook-Air ios %flutter channel
Flutter channels:
* master
  beta
  stable

enter image description here

nguyên
  • 5,156
  • 5
  • 43
  • 45
0

Also experiencing the same issue, I tried @user1503606 and @MCCCS suggestion, sadly didn't work.

Looking at this answer, the issue stems from XCode 13.3 and as @y2ducky suggests, downgrading should solve the issue.

Solutions:

  • Downgrade to Xcode 13.2.1 (you can find older versions here https://developer.apple.com/download/all/ then expand it and move Xcode (Xcode.app) to Applications folder, which will replace your current Xcode 13.)
  • Wait for Apple to modify Xcode
0

Using xcode version "13.2.1" works for me. Seems like "13.3" is doing something differently

Mattias
  • 740
  • 10
  • 19
0

Here is another one that helped me to solve this issue. Go to About this mac -> storage and remove support watchOS in Xcode developer settings.

Ilya Shaubert
  • 79
  • 1
  • 5
0

Restart of iPhone solved the problem for me.

Vingtoft
  • 13,368
  • 23
  • 86
  • 135
0

I brought another solution.

I tried multiple solutions which mentioned in this question, but all failed. So, I just tried from flutter starting project. It did build perfectly. After adding some libraries, the library starts to require more higher ios version.

I usually upgrade ios version by Podfile like this,

# Uncomment this line to define a global platform for your project
platform :ios, '12.0'

but, instead of that, I upgraded ios version with Runner.xcworkspace and ios/Flutter/AppframeworkInfo.plist according to this link. https://docs.flutter.dev/deployment/ios#review-xcode-project-settings

and after that, I finally succeeded to build project.

0

This also could be a problem with your pubspec.lock file. Some version of libraries probably trying to use Watch Support. That was the my case. So, I fixed some libraries's versions and then it worked fine.

nesimtunc
  • 849
  • 7
  • 28
0

After a couple of days of trying all the solutions on the internet. I finally ended up deleting the ios folder inside the project and creating it again using flutter . then Open Terminal and go to the project and do the follwing.

  • pub get
  • cd ios
  • pod install

And you can run the app now.

Abdelaty
  • 11
  • 4
0

It could be this:

Try turning off your Apple Watch. I know... I know. I ignored it for a long time, then dug into the logs, the error messages, researched, etc.

The device name format changes when building when there's a watch involved and can sometimes hang up the Flutter tools because - well, because they're garbage and don't take that into consideration.

I basically just can't use my Apple Watch when I'm building on Flutter (some times), like at all. I have to power it down completely.

After you get a successful build, you may or not be able to turn it back on and have the builds succeed. It's hit and miss.

I get this problem every few weeks, and 100% of the time, it's my Apple Watch being on, changing the build targets that Flutter reads, presumably through Xcode.

** shrug **

ChrisH
  • 975
  • 12
  • 21
  • Something like this might be your culprit (the "Preparing the watch for..." part of the device name): { platform:iOS, id:00008110-001E245122F9801E, name:VZW13pm, error:Device is busy (Preparing the watch for development via VZW13pm) } – ChrisH Jun 14 '22 at 19:11
0

In my case it was as simple as a new location added to assets within pubspec.yaml


  assets:
    - assets/images/
    - assets/images/icons # this line broke the whole project because of a missing /

Mohamed Mo Kawsara
  • 4,400
  • 2
  • 27
  • 43
0

What helped in my case was to run update Xcode CLI to the newest (version: 13.4.0.0.1.1651278267 ) which was only displayed with --all --install --force:

softwareupdate --all --install --force
th_lo
  • 461
  • 3
  • 18
0

The solution I found was:

Go to https://developer.apple.com/download/all/

Search for: Command Line Tools | Download my Xcode version 13.4.1

Install the package normally, after installation open the xcode and try the Build again.

rodolfocop
  • 72
  • 3
0

==> Open Xcode

==> Go to Build Setting


==> Filter with FLUTTER_ROOT

==> Change FLUTTER_ROOT PATH (Put Flutter Sdk Path)

==> Flutter Clean

==> Flutter Build IOS

Anilkumar Patel
  • 2,229
  • 1
  • 10
  • 9
0

In my case, this is my errors

Error output from Xcode build:
↳
    2022-05-18 15:24:19.369 xcodebuild[2195:13656] Requested but did not find extension point with identifier
    Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of
    plug-in com.apple.dt.IDEWatchSupportCore
    2022-05-18 15:24:19.369 xcodebuild[2195:13656] Requested but did not find extension point with identifier
    Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension
    Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    ** BUILD FAILED **

/Users/user/flutter/packages/flutter_tools/bin/xcode_backend.sh:12: parse error near `('
Command PhaseScriptExecution failed with a nonzero exit code

I suspect with /Users/user/flutter/packages/flutter_tools/bin/xcode_backend.sh:12

Original content:

...
function follow_links() (
    ...
)

PROG_NAME="$(follow_links "${BASH_SOURCE[0]}")"
...

I change it to

...
function follow_links() {
    ...
}

PROG_NAME="$(follow_links "$0")"
...

Then the build is successful.

My conclusion is that "Error output from Xcode build" is just a warning. Error is due to other reason. In my case, it is in xcode_backend.sh

0

if it's error goes like,

Error: Cannot run with sound null safety, because the following dependencies don't support null safety:

run this command flutter run --no-sound-null-safety

achinthaishane
  • 77
  • 1
  • 2
  • 9
0

In my case I had this error in a single project only.

The solution was to open Xcode, go to Target->Build Phases->Run Script. Disable or delete run scripts if any.

MineConsulting SRL
  • 2,340
  • 2
  • 17
  • 32
0

For me what worked was

  1. Delete the pubspec.lock
  2. Delete the Podfile.lock
  3. flutter clean
  4. flutter build ios
Ramesh Guntha
  • 37
  • 1
  • 6
0

first make sure that dart:html or dart:js packages are not being used in any file. if you see one of that packages is being used remove it and build the project.

if everything is okay perform below commands to solve this issue:

first remove commandlinetools

sudo rm -rf /Library/Developer/CommandLineTools

Reinstall CommandLineTools

xcode-select --install

Select CommandLineTools

sudo xcode-select -s /Library/Developer/CommandLineTools
aligur
  • 3,387
  • 3
  • 34
  • 51
0

In my case, I changed the version number in my pubspec file from 1.0.0+1 to 1.0.0 which seems to have changed the type from a string to number. Flutter's documentation on this doesn't mention anything about type so maybe there is something happening on my machine that causes this value in a yaml file to be interpreted a certain way. However, adding quotes to make it "1.0.0" fixed the issue.

Garrett
  • 1,576
  • 4
  • 27
  • 51
0

After weeks of trial and error the following steps fixed the issue:

  1. Make a backup of the ios folder (if not using Git)
  2. Delete the ios folder
  3. Run flutter clean
  4. Run flutter create . from the app root directory, this will recreate a new ios folder
  5. Add the Podfile, Info.plist and any other such files from the old ios folder back to the new ios folder (eg. googleservice_info.plist)
  6. Run flutter pod install
  7. Run flutter run or flutter build ios and it should work

source: https://github.com/flutter/flutter/issues/100161 (answer by AshfaqAshi)

I tried nearly all the other answersto this question but none worked:

  • Cleaning Flutter directory and rebuilding (flutter clean,flutter pub upgrade, etc)
  • Running xcrun commands in the command line (e.g. xcrun -sdk iphoneos --show-sdk-path)
  • Adding the SDK path to my .zshrc file
  • Downgrading XCode from 13.3 to 13.2
  • Adding the line in the Podfile to handle a bug in XCode 13.3 regarding the 'DKImagePickerController/PhotoGallery'
SamHeyman
  • 207
  • 3
  • 13
0

I deleted the Simulator that I was using and created a new one which solved the issue for me.

M--
  • 25,431
  • 8
  • 61
  • 93
Lahib
  • 1,305
  • 5
  • 34
  • 62
0

Run this when the project was running fine before:

$ flutter clean
$ flutter pub get
SwiftiSwift
  • 7,528
  • 9
  • 56
  • 96
-1

My Xcode version is 13.2 and my Flutter version is 3.0.1 stable I found the solution by downgrading flutter version and upgrading again

  1. Open the terminal
  2. flutter downgrade and wait for the process to finish. Once done, go to step 3
  3. flutter upgrade and wait for the process to finish. Recompile your project when the process is finished

. I hope this solution helps people with similar issues!

Abdullah T
  • 127
  • 3
  • 10
-4

This works for me https://github.com/nvm-sh/nvm/issues/2764 I run:

➜  ~ source ~/.nvm/nvm.sh
➜  ~ nvm deactivate
/Users/username/.nvm/*/bin removed from ${PATH}

➜  ~ source ~/.nvm/nvm.sh
Raul Benitez
  • 35
  • 1
  • 7