react-native-compressor icon indicating copy to clipboard operation
react-native-compressor copied to clipboard

iOS build fails on Xcode 16 / iOS 26

Open ShahilMangroliya opened this issue 3 months ago • 15 comments

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 avatar Sep 17 '25 06:09 ShahilMangroliya

👋 @ShahilMangroliya Thanks for opening your issue here! If you find this package useful hit the star🌟!

github-actions[bot] avatar Sep 17 '25 06:09 github-actions[bot]

Running into the same issue

felixspitzer avatar Sep 17 '25 08:09 felixspitzer

Same issue, app cannot build anymore in XCode 26 because of obsolete AssetsLibrary used in react-native-compressor

ymc-thzi avatar Sep 17 '25 08:09 ymc-thzi

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

ShahilMangroliya avatar Sep 17 '25 09:09 ShahilMangroliya

+1 same here

johnsnaply avatar Sep 17 '25 15:09 johnsnaply

Same error here, @numandev1 any fix? (Edit: The patch above from @ShahilMangroliya works, used patch-package)

DvzZDev avatar Sep 17 '25 18:09 DvzZDev

mport AssetsLibrary

Dealing with the same error and this patch works perfectly, I use patch-package to apply this

TwanLuttik avatar Sep 17 '25 23:09 TwanLuttik

fixing patch:

react-native-compressor+1.12.0.patch

RoiDayan1 avatar Sep 18 '25 08:09 RoiDayan1

hope this gets merged asap

AyoParadis avatar Sep 18 '25 11:09 AyoParadis

@numandev1 Please fix

garshythoel avatar Sep 18 '25 16:09 garshythoel

@numandev1 Any plans for fixing this ?

ursnj avatar Sep 19 '25 06:09 ursnj

it seems to be fixed in the new version: 1.13

mohammadamin16 avatar Sep 20 '25 13:09 mohammadamin16

I can confirm it is fixed in 1.13.0

petrbela avatar Sep 21 '25 11:09 petrbela

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'.

shubhamdev098 avatar Sep 30 '25 07:09 shubhamdev098

Confirming as well that it is fixed in 1.13.0.

ShantIssa avatar Oct 03 '25 08:10 ShantIssa