1

I recently installed Xcode 26 (build 17A324) on macOS and when I try to build my iOS project I get this error:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.0.sdk/usr/lib/swift/AssetsLibrary.swiftmodule/arm64e-apple-ios.swiftinterface:1:1: failed to build module 'AssetsLibrary'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 6.2 effective-5.10 (swiftlang-6.2.0.17.14 clang-1700年3月17日.1)', while this compiler is 'Apple Swift version 6.2 effective-5.10 (swiftlang-6.2.0.19.9 clang-1700年3月19日.1)').

The strange thing is that I am not using ALAssetsLibrary anywhere in my project code (I know it has been deprecated for years). Still, the compiler seems to try and import it from the iOS 26 SDK, which then fails because of a mismatch between the SDK and the compiler toolchain.

I have already tried cleaning Derived Data, switching to the default toolchain in Xcode, and fixing the SDK symlink (iPhoneOS26.0.sdk -> iPhoneOS.sdk). None of these worked.

HangarRash
16.3k5 gold badges27 silver badges62 bronze badges
asked Sep 22 at 15:55
0

4 Answers 4

8

Don't know how, but this worked for me:

Right click on the error -> Show in Finder -> Delete AssetsLibrary -> Build and Run successfully on device running iOS 26

answered Sep 30 at 21:06
Sign up to request clarification or add additional context in comments.

3 Comments

Weirdly this works
It is worked for me!!
Awesome hint. For a few seconds I was to sure how to delete but moving up a level in Finder was the thing. The I could see I was inside AssetsLibrary. I guess this works because there is something in my simulator that should not be there....
3

ALAssetsLibrary is probably being imported from a react native extension library that depends on it. You can search for import AssetsLibrary in your node_modules subdirectory to identify which one it is

For example:

find node_modules -iname "*.swift" | xargs grep AssetsLibrary
node_modules/react-native-compressor/ios/Video/VideoMain.swift:import AssetsLibrary

This identifies react-native-compressor as the culprit.

Then search your package.json etc to see the version used, and check whether there's a native upstream version that corrects this, and upgrade to it.

The following packages have this issue:

  • react-native-compressor - fixed in version 1.13.0
  • react-native-blob-utils - see issue #438 which also has a patch

If there isn't an upstream version, you may need to use patch-package to alter the source code of the module - see this ticket for some examples.


 
answered Sep 30 at 15:20

1 Comment

Well seen and Thank you !
0

In my case, open Xcode and go to Find > Text > Containing, search for AssetsLibrary and delete all import AssetsLibrary you find.

That's it.

answered Oct 15 at 16:34

Comments

-2

AssetsLibrary is a fairly old library for accessing the users' photo. It has long been deprecated. You already know that. Apple introduced the Photos framework as a replacement.

Since Xcode 26 requires iOS 15 as the minimum supported deployment target, and the AssetsLibrary framework was deprecated long ago, it’s no longer available or recommended to use in newer versions of iOS and Xcode.

When I tried to reproduce your issue, I get this clear warning:

'ALAssetsLibrary' is unavailable in iOS: Use PHPhotoLibrary from the Photos framework instead.

Also, Quote Apple Staff, Quinn "The Eskimo" , he confirmed this is a bug(through I think differently, Apple is Dropping its support in Xcode26):

This is obviously a bug and I encourage you to file a report about it. Please post your bug number, just for the record.


If your code does not implicitly import this AssetsLibrary. Then we have to check:

  1. If it is imported/linked by 3rd party dependencies
  2. If you mistakenly linked the AssetsLibrary(maybe in General -> Frameworks, Libraries, and Embedded Content)

You can list the podfile.lock or Package.resolved so that we can have a further analysis.

Lastly, you can download a last successfully compiled version of Xcode(since Xcode26 failed to compile it now), goto the built product folder, find the build main executable file, and execute otool -L <path_to_your_executable>, and normally that will list all the linked frameworks.

answered Sep 22 at 23:06

7 Comments

Why do you say that Xcode 26 requires a minimum deployment target of iOS 15 or later? It supports iOS 12 and later. I’m not saying you should support that far back. Too much has changed since then. But Xcode 26, like Xcode 15, lets you manually enter iOS 12 in the minimum deployment target setting.
It's confirmed, create a project in xcode, the minimum supported version in General -> Minimum Deployments is iOS 15.
Also, apple put this info on their website: developer.apple.com/support/xcode
How is it confirmed? I just typed 12.0 into the Minimum Deployments field on the General tab and the project built fine. You are not restricted to just the values in the drop down list. You can manually type other values. As proof, enter 11.0 and then try to build. You then get an error telling you the valid range is 12.0 to 26.0.99. If you enter 12.0 then the project builds. Of course you will get lots of deprecation warning. But that’s a separate issue.
Bro, don't argue with me on this, focus on this error message from compiler: 'ALAssetsLibrary' is unavailable in iOS: Use PHPhotoLibrary from the Photos framework instead!
Why would I focus on that error? That’s not the error from the question. That’s an error that your setup generated, not the OP’s. Or at least the OP made no mention of that specific error in their post.
try to reproduce first

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.