Skip to content

iOS build fails on Xcode 16 / iOS 26 #370

Open

Description

@ShahilMangroliya

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
  • iOS

React Native Version

"react-native": "0.81.4",

React Native Compressor Version

"react-native-compressor": "^1.12.0",

Reproducible Steps And Demo

Activity

  1. github-actions commented on Sep 17, 2025

    @github-actions

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

  2. felixspitzer commented on Sep 17, 2025

    @felixspitzer

    Running into the same issue

  3. ymc-thzi commented on Sep 17, 2025

    @ymc-thzi

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

  4. ShahilMangroliya commented on Sep 17, 2025

    @ShahilMangroliya
    Author

    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
  5. johnsnaply commented on Sep 17, 2025

    @johnsnaply

    +1 same here

  6. DvzZDev commented on Sep 17, 2025

    @DvzZDev

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

  7. TwanLuttik commented on Sep 17, 2025

    @TwanLuttik

    mport AssetsLibrary

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

  8. roidayan1 commented on Sep 18, 2025

    @roidayan1
  9. AyoParadis commented on Sep 18, 2025

    @AyoParadis

    hope this gets merged asap

  10. garshythoel commented on Sep 18, 2025

    @garshythoel

    @numandev1 Please fix

  11. ursnj commented on Sep 19, 2025

    @ursnj

    @numandev1 Any plans for fixing this ?

  12. mohammadamin16 commented on Sep 20, 2025

    @mohammadamin16

    it seems to be fixed in the new version: 1.13

  13. petrbela commented on Sep 21, 2025

    @petrbela

    I can confirm it is fixed in 1.13.0

  14. shubhamdev098 commented on Sep 30, 2025

    @shubhamdev098

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

  15. ShantIssa commented on Oct 3, 2025

    @ShantIssa

    Confirming as well that it is fixed in 1.13.0.

  16. XChikuX commented on Jul 14, 2026

    @XChikuX
    Contributor

    @numandev1 Safe to close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions