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

iOS build failed

Open SSzzPP opened this issue 11 months ago • 13 comments

Expo's EAS build failed for iOS.

Version 1.9.0 of React Native Compressor is works fine, I'm sure I just upgraded version to 1.10.1

Platform

  • [x] iOS

React Native Version

  • 0.73.6

React Native Compressor Version

-1.10.1

Error log

❌  (node_modules/react-native-compressor/ios/Video/NextLevelSessionExporter.swift:376:69)

  374 |         for audioTrack in audioTracks {
  375 |             let mediaSubtypes = audioTrack.formatDescriptions.filter { CMFormatDescriptionGetMediaType($0 as! CMFormatDescription) == kCMMediaType_Audio }.map { CMFormatDescriptionGetMediaSubType($0 as! CMFormatDescription) }
> 376 |             for mediaSubtype in mediaSubtypes where mediaSubtype != kAudioFormatAPAC {
      |                                                                     ^ cannot find 'kAudioFormatAPAC' in scope
  377 |                 audioTracksToUse.append(audioTrack)
  378 |             }
  379 |         }

SSzzPP avatar Dec 05 '24 10:12 SSzzPP

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

github-actions[bot] avatar Dec 05 '24 10:12 github-actions[bot]

I added a patch locally and added import AudioToolbox to the NextLevelSessionExporter.swift file. After repackaging, everything worked fine.

SSzzPP avatar Dec 05 '24 10:12 SSzzPP

@SSzzPP can you make a PR of it?

numandev1 avatar Dec 05 '24 10:12 numandev1

@SSzzPP can you remove import AudioToolbox and use import CoreAudioTypes and check?

numandev1 avatar Dec 05 '24 10:12 numandev1

@SSzzPP can you check 1.10.2 version?

numandev1 avatar Dec 05 '24 11:12 numandev1

@SSzzPP can you check 1.10.2 version?

it's still happenning in 1.10.2

serolgames avatar Dec 05 '24 12:12 serolgames

@SSzzPP can you remove import AudioToolbox and use import CoreAudioTypes and check?

Yeal, I tried adding import CoreAudioTypes and It doesn't seem to work❌

SSzzPP avatar Dec 05 '24 12:12 SSzzPP

@serolgames can you connect with me on LinkedIn https://www.linkedin.com/in/numandev/ as i wanna send you some code for test

numandev1 avatar Dec 05 '24 13:12 numandev1

Um, I rarely use LinkedIn, can you add me on Discord? https://discord.gg/HReEzU62

SSzzPP avatar Dec 05 '24 13:12 SSzzPP

@SSzzPP can you try https://github.com/numandev1/react-native-compressor/releases/tag/v1.10.3

numandev1 avatar Dec 05 '24 14:12 numandev1

In fact, this error is lower than Xcode16.0, kAudioFormatAPAC is not a predefined constant of CoreAudioTypes.

I provide two solutions:

  • For app builds with eas, e.g. xcode version = 15.4, you need to upgrade the xcode version of the build environment.
  • For plugins, you need to define kAudioFormatAPAC manually.

env

SSzzPP avatar Dec 05 '24 15:12 SSzzPP

Confirmed 1.10.2 doesn't work, 1.10.3 works. It would be nice to keep Xcode 15 compatibility for now if possible since it feels like a major breaking change to drop it.

gaearon avatar Dec 05 '24 17:12 gaearon

@gaearon i agree with you, sorry for bug 🙏🏻

numandev1 avatar Dec 05 '24 17:12 numandev1