react-native-compressor
react-native-compressor copied to clipboard
iOS build failed
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 Thanks for opening your issue here! If you find this package useful hit the star🌟!
I added a patch locally and added import AudioToolbox to the NextLevelSessionExporter.swift file. After repackaging, everything worked fine.
@SSzzPP can you make a PR of it?
@SSzzPP can you remove import AudioToolbox and use import CoreAudioTypes and check?
@SSzzPP can you check 1.10.2 version?
@SSzzPP can you remove
import AudioToolboxand useimport CoreAudioTypesand check?
Yeal, I tried adding import CoreAudioTypes and It doesn't seem to work❌
@serolgames can you connect with me on LinkedIn https://www.linkedin.com/in/numandev/ as i wanna send you some code for test
Um, I rarely use LinkedIn, can you add me on Discord? https://discord.gg/HReEzU62
@SSzzPP can you try https://github.com/numandev1/react-native-compressor/releases/tag/v1.10.3
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.
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 i agree with you, sorry for bug 🙏🏻