iOS build fails on Xcode 16 / iOS 26
Current behavior
On Xcode 16 with the iOS 18 SDK, the build fails because react-native-compressor imports the removed AssetsLibrary framework and references ALAssetsLibrary. The compiler suggests using PHPhotoLibrary. This blocks archives on current Apple toolchains.
Expected behavior
It should work
Platform
- [] Android
- [X] iOS
React Native Version
"react-native": "0.81.4",
React Native Compressor Version
"react-native-compressor": "^1.12.0",
Reproducible Steps And Demo
👋 @ShahilMangroliya Thanks for opening your issue here! If you find this package useful hit the star🌟!
Running into the same issue
Same issue, app cannot build anymore in XCode 26 because of obsolete AssetsLibrary used in react-native-compressor
Fix
diff --git a/node_modules/react-native-compressor/ios/Image/ImageCompressor.swift b/node_modules/react-native-compressor/ios/Image/ImageCompressor.swift
index 6b7cc49..e2f551a 100644
--- a/node_modules/react-native-compressor/ios/Image/ImageCompressor.swift
+++ b/node_modules/react-native-compressor/ios/Image/ImageCompressor.swift
@@ -370,8 +370,10 @@ class ImageCompressor {
var results: PHFetchResult<PHAsset>?
if imageURL?.scheme?.caseInsensitiveCompare("assets-library") == .orderedSame {
- assetID = imageURL?.absoluteString ?? ""
- results = PHAsset.fetchAssets(withALAssetURLs: [imageURL!], options: nil)
+ // ALAsset URLs are no longer supported in iOS 18+
+ // Return an error or handle gracefully
+ print("Warning: ALAsset URLs are no longer supported in iOS 18+. Please use PHAsset local identifiers instead.")
+ return
} else {
assetID = imagePath.replacingOccurrences(of: "ph://", with: "")
results = PHAsset.fetchAssets(withLocalIdentifiers: [assetID], options: nil)
diff --git a/node_modules/react-native-compressor/ios/Video/VideoMain.swift b/node_modules/react-native-compressor/ios/Video/VideoMain.swift
index 6fe5e9c..af8a0b5 100644
--- a/node_modules/react-native-compressor/ios/Video/VideoMain.swift
+++ b/node_modules/react-native-compressor/ios/Video/VideoMain.swift
@@ -1,5 +1,4 @@
import Foundation
-import AssetsLibrary
import AVFoundation
import Photos
import MobileCoreServices
+1 same here
Same error here, @numandev1 any fix?
(Edit: The patch above from @ShahilMangroliya works, used patch-package)
mport AssetsLibrary
Dealing with the same error and this patch works perfectly, I use patch-package to apply this
hope this gets merged asap
@numandev1 Please fix
@numandev1 Any plans for fixing this ?
it seems to be fixed in the new version: 1.13
I can confirm it is fixed in 1.13.0
this issue is occuring for package 'react-native-compressor' package when buidling the react native ios app. My issue was resolved when i updated the package to latest version '1.13'.
Confirming as well that it is fixed in 1.13.0.