I've found the issue! I checked in TARGETS > Swift Language Version -> And I was using Swift 4 in the project. Changed it to Swift 6 and done!
I realized because of this error in Xcode: 'jpegData(compressionQuality:)' has been renamed to 'UIImageJPEGRepresentation(::)'
It was telling me to use an older version, which made no sense.