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.
4 Answers 4
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
3 Comments
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 version1.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.
1 Comment
In my case, open Xcode and go to Find > Text > Containing, search for AssetsLibrary
and delete all import AssetsLibrary
you find.
That's it.
Comments
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:
- If it is imported/linked by 3rd party dependencies
- 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.
7 Comments
General
-> Minimum Deployments
is iOS 15.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.'ALAssetsLibrary' is unavailable in iOS: Use PHPhotoLibrary from the Photos framework instead!