367

After installing Xcode 14.3 in order to run my app on my iOS 16.3 iPhone XS. I get the following error:

File not found: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a

How can I fix it?

0

36 Answers 36

386

Add the below code to the Podfile. It works for me. Version 14.3 beta 2 (14E5207e)

post_install do |installer|
    installer.generated_projects.each do |project|
        project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
            end
        end
    end
end
8
  • 3
    This worked for me with my flutter app! I changed the target to 11. Xcode 14.3, Flutter 3.7.7, testing out on iPhone 14 Pro Max simulator. This error came out of the blue today it seems like. Mar 31 at 18:17
  • 11
    This solution works for me. Instead of 13.0, I set the IPHONEOS_DEPLOYMENT_TARGET to 11.0 only. I'm using Xcode v14.3 on macOS Ventura 13.3. Make sure you run pod install again after enter the given code on your podfile. ^_^ Apr 2 at 20:54
  • 1
    What if I am not using Pods? How to resolve this?
    – Developer
    Apr 17 at 6:59
  • 3
    The latest Flutter version (3.3.10) includes a fix! No need to mess with the Info.plist anymore. Apr 29 at 8:34
  • 1
    Doesn't work 👎🏻😒. Use @JustAimz's answer stackoverflow.com/a/75867043/9185411. IMPORTANT!replace the existing post_install with the given one
    – Mad World
    May 11 at 15:00
249

Open Terminal and go to the following folder:

cd /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/

Create the folder "arc":

Go to System PreferencesSecurity & PrivacyFull Disk AccessTerminal, and do:

sudo mkdir arc
cd  arc
sudo git clone https://github.com/kamyarelyasi/Libarclite-Files.git .

Give the necessary permissions:

sudo chmod +x *

Now you will be able to build and run, but not Archive.

To fix this, follow the steps:

In Xcode, navigate to:

  • PodsTarget Support FilesPods-Runner or Pods-App

  • Open file Pods-Runner-frameworks.sh or Pods-App-frameworks.sh

  • Find the line: source="$(readlink "${source}")"

  • Replace it by: source="$(readlink -f "${source}")"

Then...Archive

Enter image description here

10
  • 1
    Big thanks. This works for me: 1 - Download files from Libarclite-Files 2- Add them to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/ Apr 5 at 21:44
  • 2
    thanks, just move cloned files from the Libarclite folder ( /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/ ) to the parent folder (in the lib folder ), then give permission to it. Apr 6 at 12:08
  • 1
    Before changing Symlinked in Pods-Runner-frameworks.sh run: pod install Apr 8 at 23:56
  • 44
    I wanna point out that it's not a good idea to give random files from GitHub root and executable permissions
    – DarkNeuron
    Apr 10 at 16:34
  • 2
    @MuhammadShahzad i read it somewhere that statement was pods path getting updated so pods are not readable on old path that's why it's happened.
    – Jatin
    Apr 18 at 10:03
163

You can manually modify the minimum deployment version of the third-party framework.

e.g.: iOS 8.0 --> iOS 11.0

An image showing a settings menu within xcode. On the left side, 'Pods' is selected. Then, 'General' is selected. In the center of the screen, a dropdown menu with the title "Minimum Deployments" is higlighted, and is currently set to iOS 8.0.

5
  • 5
    For me, it was my FMDB dependency that needed to be updated to 11.0. Then everything worked. Apr 3 at 13:20
  • This works for me after I set ALL pods to the same iOS version.
    – Rick
    Apr 13 at 15:07
  • This happened to me for a completely diff pod file (not flutter). And also this solution worked for me. And I'll tell you why this is the best answer... 1. There is NO reason for anyone to install libarclite_iphoneos.a 2. This mod is clean and you dont have to write yet another script file to fix this error..
    – qiksand
    Apr 15 at 4:49
  • 1
    @MatthewTrent Updated FMDB deployment target from 8 to 11 did it, thanks.
    – omega_mi
    May 25 at 4:42
  • I also had to manually update some related pods (Firebase+Core+Analytics+etc.), and I repeated this step for other pods until I stopped getting the error. Oct 17 at 23:06
69
post_install do |installer|
    installer.generated_projects.each do |project|
        project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
            end
        end
    end
    installer.pods_project.targets.each do |target|
        flutter_additional_ios_build_settings(target)
    end
end

This is the right code for podfile.

7
  • 1
    Being a complete novice here, how and where do I implement this script?
    – Andy
    Mar 29 at 10:37
  • 2
    I want my app to support down to iOS 11, will this affect it?
    – Crizant
    Mar 31 at 9:29
  • @Andy You need to add this to the end of your Podfile file, found in the ios directory of your application. There will be another structure that looks like post_install do |installer| {logic} end Apr 2 at 13:25
  • 1
    Thanks! You saved my day! Also updated minimum deployment version of Pods.xcodeproj to same as main project. After that exec pod install, clean build folder and build project.
    – orange01
    Apr 16 at 11:37
  • It works. Xcode 14.3. Don't forget to pod install, then clean.
    – djdance
    May 11 at 16:54
68

Actually, the other answers are correct, but to an amateur, it's still quite difficult to figure it out.

Answer:

It seems like iOS stopped supporting iOS 8, so the minimum should be 11.0

There are 2 ways to upgrade your iOS:

1- Manually update ALL targets with a minimum deployment at 11.0.

enter image description here

It will work perfectly but tiring, so...

2- Adjust the pod code to force all targets with a minimum deployment at 11.0.

enter image description here

post_install do |installer|
    installer.generated_projects.each do |project|
          project.targets.each do |target|
              target.build_configurations.each do |config|
                  config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
               end
          end
   end
end

Remember to clean and de-integrate pod and re-install it.

cd [project directory]
pod deintegrate
pod clean
pod install
6
  • My attached pictures are minimum deployment 12.0 cuz, some of my dependencies require higher than 11.0 Apr 24 at 5:55
  • 5
    'pod clean' no longer exists
    – pw2
    Apr 27 at 8:04
  • Thanks, 1st solution is enough to work, no need to go for second one. Set minimum deployment at 11.0. Jun 6 at 2:41
  • @KasunUdaraJayasekara first solution you have to update manually everytime whenever pod install/re-install. Second solution is one time change.
    – Dharma
    Jun 6 at 7:20
  • pod clean doesn't exist. Use pod cache clean --all instead Aug 8 at 9:37
36

I updated the post_install in my Podfile to:

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
      end
    end
  end

  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

Additionally, I set the Minimum Deployments to 13 as well (RunnerTargetsRunner):

Xcode target minimum deployment target

After this, I updated the project's pods by running this in the terminal:

cd ios;

# Remove the pods
pod deintegrate;

# Remove the Podfile.lock
rm -f Podfile.lock;

# Installs the pods
pod install --repo-update;

Try running the app from your IDE; it should work now.

If you continue to have issues, try cleaning the build folder within Xcode and running the app, also within Xcode.

Xcode clean build folder

Once you have successfully run the app from Xcode, go back to your IDE and you'll be able to run the app.

2
  • 6
    This works but now I can't build xcarchive or ipa. Do you have any fixes for this? Thanks for the answer btw
    – Anton
    Apr 1 at 10:56
  • tonly this answer works for me Jul 26 at 7:59
28

Update

This answer could be valid for the question in this topic as well

The old answer

It's worked for me.

cd /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/

sudo mkdir arc

# While executing the above command, the OS will block it
# and give an error. Allow permission from the settings
# and run the command again.

cd arc
sudo git clone https://github.com/kamyarelyasi/Libarclite-Files.git .

You may also need to run this command: sudo chmod +x *

6
  • 1
    it work for me when I put sudo git clone https://github.com/kamyarelyasi/Libarclite-Files.git . Apr 12 at 12:16
  • I edited the post to include sudo before the git clone Apr 25 at 7:01
  • It had worked for me without sudo before. Still, there's no harm, it can be added.
    – Fatih
    Apr 29 at 6:30
  • Good and Quick Solution. It works May 9 at 8:12
  • Please change your answer to not use "edit" (near "Changelogs"). The answer should be as if it was written right now. May 11 at 13:35
25

Since Xcode 14.3 you have to set all your Pods to a minimum deployment target of iOS 11. Then it will work

  1. Navigate to [Pods] project in the Project Navigator.
  2. Select "each" target under it and perform the step 3 below.
  3. Change the Minimum Deployment Target to iOS 11 version in the drop-down list therein.
3
  • How do you do that?
    – Houman
    Jun 4 at 12:40
  • @Houman check updated post Jun 5 at 5:45
  • This fixed it for me. Thanks Jun 30 at 10:05
16

After updating to XCode 14.3 I got the same error message as described in the question. In my case it was an error in a pod that was shown. My project is a native iOS app and no flutter like answers from others seem to be dealing with.

The following worked for me:

  1. Comment out all pods in Podfile by adding # in front of each pod.
  2. Close XCode.
  3. Run pod install (will remove all pods).
  4. Open xcworkspace project in XCode again and do a clean (command-shift-k).
  5. Uncomment pods in Podfile and add this before the last end in the Podfile (change 11.0 to the minimum version you want to support):
post_install do |installer|
    installer.generated_projects.each do |project|
        project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
            end
        end
    end
end
  1. Close XCode.
  2. Run pod install.
  3. Open xcworkspace project in XCode and error should be gone.
2
  • 1
    Worked for me as well after upgrading to Xcode 14.3 Apr 12 at 6:34
  • Thank God for Stack Overflow. Updating Xcode is always a terrifying experience. For native iOS apps, this is my favorite answer.
    – trndjc
    May 16 at 2:50
16

From the Flutter team.

No need for workarounds, just update Flutter to latest version 3.7.11 and run flutter upgrade in your project, and you should be good.

https://github.com/flutter/flutter/issues/124433.

Just tested in my Flutter project, and I can confirm I can build and archive the xcode project

0
13

Just create a folder called 'arc' in the following path:

/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/

Download and paste the contents of this repository into the folder you just created and then build again.

https://github.com/kamyarelyasi/Libarclite-Files

3
  • This did not work for as i keep getting "Command PhaseScriptExecution failed with a nonzero exit code" and I did flutter clean and even run pod install but still.
    – yendis
    Apr 3 at 15:21
  • @yendis, did you try an earlier solution suggested here itself -> stackoverflow.com/a/75924853/1349159 It worked for me
    – ranjjose
    Apr 6 at 12:21
  • It solves the issue partially. After doing this, you can build and run the app but Archiving for uploading AppStore still fails.
    – Elmar
    Apr 14 at 6:15
13

Here are the step-by-step instructions, including the image links:

  1. Open a web browser and go to the following URL: https://github.com/kamyarelyasi/Libarclite-Files

  2. On the GitHub page, you will see a list of files. Locate the file named libarclite_iphonesimulator.a.

    GitHub Files

  3. Click on the file name (libarclite_iphonesimulator.a) to open it.

  4. On the file page, click the "Download" button to download the file to your computer. Choose a suitable location to save the file.

  5. After the download is complete, locate the downloaded file (libarclite_iphonesimulator.a) on your computer.

  6. Open the Finder application on your Mac.

  7. In the menu bar, click on "Go" and select "Go to Folder" from the dropdown menu.

  8. In the "Go to the folder" dialog box, enter the following path and click the "Go" button: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/

    Go to Folder

  9. If the arc directory does not exist in the specified path, right-click on the "arc" folder in the Finder and select "New Folder" from the context menu. Rename the newly created folder as "arc".

  10. Now, locate the downloaded file (libarclite_iphonesimulator.a) and copy it.

  11. Go back to the Finder window containing the arc directory.

  12. Right-click on an empty space within the arc directory and select "Paste Item" from the context menu. This will paste the copied file (libarclite_iphonesimulator.a) into the arc directory.

  13. Once the file is successfully copied, you have completed the process of downloading the files and copying the libarclite_iphonesimulator.a file to the specified location.

1
  • 1
    I succeed by this way, thanks
    – muyoungko
    Aug 5 at 0:28
12

I spent hours and I've found out the problem. It was Xcode version 14.3.

I tried the above suggestions (update your podfile) and it worked, but the problem is you can't build IPA files or XCArchives.

Here's what I did in my case:

  1. I downloaded Xcode version 14.2 here https://xcodereleases.com/

  2. Just set the Command Line Tools to Xcode 14.2

P.S.: Just to make sure, run the usual first:

flutter clean && flutter pub get

With this, I was able to build and create XCArchives. I hope this helps other Flutter developers!

Xcode Settings

9

I figured out the problem. I had to increase the deployment target for the Pod module that was causing the error to iOS 15.0. At least, that's what worked for me.

9

tl;dr: Change deployment target without downgrading pods

Many answers here are about updating IPHONEOS_DEPLOYMENT_TARGET in the post_install hook of Cocoapods. I had to tweak this solution a little bit, since my project uses pods which already have a higher deployment target, and the provided solutions would downgrade them, causing their build to break (e.g. when the pods are using newer APIs).

So here's my patched approach, to only change the deployment target if it's too low:

post_install do | installer |
  installer.generated_projects.each do |project|
    project.targets.each do |target|
      target.build_configurations.each do |config|
        if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].split('.').first.to_i < 11
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
        end
      end
    end
  end
end
1
  • Yep this seem the best answer for multiple pod versions. I use it like this: post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] == '8.0' config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0' end end end end
    – david72
    Aug 17 at 23:35
7

My system: Macbook pro M1

Xcode: 14.3


To fix this issue, you must ensure that the iOS Deployment Target of your pods is 11.0; pods with a iOS Deployment Target of 8.0 were causing the issue for me.

Example: pods that were set to iOS Deployment Target 8.0: leveldb-library, nanopb.

You will receive this error for any pods that are set to 8.0 when building, so change them to 11.0 either manually or with a post install script in your Podfile.

2
  • 1
    prefect work for me.
    – slboat
    Jul 25 at 2:26
  • Actually From Xcode 14.3, it supports 11.0 min Deployment Target.
    – Kudos
    Jul 25 at 5:43
3

If you are working in swift/objective-c, No further action is needed except:

  1. Navigate to [Pods] project in the Project Navigator.
  2. Select "each" target under it and perform the step 3 below.
  3. Change the Minimum Deployments value to the lowest available version in the drop-down list therein. (DO NOT type in, manually)

enter image description here

Thereafter, clean build folder from Product Menu, and hopefully you'll be able to build the project successfully.

2
  • Please do not post duplicate answers.
    – HangarRash
    Apr 21 at 16:12
  • 1
    @HangarRash Please take another look at my answer. It is well-written, straightforward and advises the readers against any unnecessary hassle such as adding extra code to the pod file, restarting Xcode etc. mentioned in other answers. More importantly, the step 2 is a must because the issue will not be resolved until it is ensured that each and every target is set to the lowest available version shown in the Minimum Deployments dropdown.
    – programmer
    Apr 24 at 6:24
3

Nothing worked for me. I just downgraded Xcode to 14.2 and it worked!

1
  • 2
    This worked. The issue is related to new Xcode. I downgraded and it worked like charm. Thanks.
    – yendis
    Apr 3 at 16:43
3

You can try adding this code to the Pod file

    post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
    end
  end
end

Don't use this code

    post_install do |installer|
    installer.generated_projects.each do |project|
          project.targets.each do |target|
              target.build_configurations.each do |config|
                  config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
               end
          end
   end
end
3
  • is it flutter environment? flutter_additional_ios_build_settings
    – ali ozkara
    Jul 11 at 9:57
  • this solution worked for me ✅ Jul 20 at 0:37
  • this solution worked for me thank you Sep 12 at 9:44
3

It seems like some files are missing from Xcode 14.3 above (including Xcode 15). You can add them back by this command:

sudo git clone https://github.com/MojtabaHs/xcode-arc `xcode-select -p`/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc

This will add them to the currently selected Xcode. You can select another Xcode using xcode-select command and run the above command again to make it work too.

2

1. First update PodFile.

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
        end
    end
  end
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

Update target as per your need. For me 11.0 was minimum requirement. This basically updates minimum deployments from anything you have to 11.0 so you don’t need to update manually.

Now Missing file libarclite_iphoneos.a must be fixed. However, you might get another issue while generating build. If so, please go through following steps.

2. Can't generate build?

.sh Path: flutter-project-folder/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh

Steps

  1. Open Pods-Runner-frameworks.sh file from sublime (or any other)
  2. Search for source="$(readlink "${source}")" and replace it with source="$(readlink -f "${source}")"
  3. Run flutter build ipa --release
  4. [important] Now open sublime again. You will see it will remove -f. At this time immediately add -f again and save the file. Now the build should be successful.

This worked for me. Hope this helps.

Thanks

2

For me, macOS project, increase the minimum deployments version for that target.

2

Fixed in Flutter 3.7.11

flutter upgrade

https://github.com/flutter/flutter/issues/124340

https://github.com/flutter/flutter/wiki/Hotfixes-to-the-Stable-Channel

1

I would like to improve moveFastLink's solution.

There are two things that I think could be improved:

  • In moveFastLink's solution, when one of the pods already has a higher deployment target, it will be "downgraded" to 13.0.
  • OP asks for a solution that solves his problem. For the problem to be solved, it's not necessary so set the target version of every pod to 13.0. Instead, 11.0 very much suffices.

For these reasons I propose to add this to the Podfile of your project:

wanted_project_target = 11.0

post_install do |installer|
  installer.generated_projects.each do |project|
    project.targets.each do |target|
      target.build_configurations.each do |config|
        current_project_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f

        if current_project_target < wanted_project_target
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = wanted_project_target.to_s
        end
      end
    end
  end
end

This piece of code checks if the current IPHONEOS_DEPLOYMENT_TARGET is lower than the wanted_project_target and only re-assigns it to wanted_project_target if this is the case.

1

In one line: Just search for "iphoneos_deployment_target" in your xcode and and change any target lower than 11.0 to 11.0.

1

update flutter sdk to 3.7.12 to fix

1

100% Working and Tested

For my case I was getting error like below:

enter image description here

When I have updated my Xcode with latest version, my running project was getting error.

Executable path is a directory

later I saw in Xcode below error:

enter image description here

This is how I resolved this:

By using terminal I have added arc directory and change its permission

  1. Open the Terminal app in your Mac.

  2. Enter command:

sudo mkdir arc
  1. It will ask for permission if you haven't set permission previously for access in App Management.

enter image description here

4.Enter command in terminal:

cd  arc
  1. Enter command in terminal:
sudo git clone https://github.com/kamyarelyasi/Libarclite-Files.git .

Once this command fired now this time to change permission

sudo chmod +x *

Almost done.

Simply search in Xcode for following:

source="$(readlink "${source}")"

and just replace it by following:

source="$(readlink -f "${source}")"

its look like:

enter image description here

DONE. You are able to generate build and also can able to run in simulator.

enter image description here

0
Inside script "Pods-${TARGET}-frameworks.sh"
Inside function install_framework()
...
# Use filter instead of exclude so missing patterns don't throw errors.
# 
# 1. fix framework path at $source variable
#    framework not found at script location
source="${1}"

echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""

# 2. replace rsync --links flag with --copy-links 
#    rsync will copy files and directories instead do symlinkink
#    if don't do this, later code sign failed, when try to codesign symbolic link
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --copy-links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
...
That's all ctrl+s and archive
0

You can see the offending pod in the errors (yellow). I just changed that to my target (14)

0

I had this issue when using Pods to add Firebase to my app. What fixed it for me was: Select the ‘Pods’ project in the the file navigation on the left, then select the ‘General’ tab, select the ‘leveldb-library’ target and set the minimum deployment to iOS 11.0.

Not the answer you're looking for? Browse other questions tagged or ask your own question.