YPImagePicker icon indicating copy to clipboard operation
YPImagePicker copied to clipboard

Stored properties cannot be marked unavailable with '@available'

Open UtkuDalmaz opened this issue 3 years ago • 12 comments

Getting this error in xcode 15 beta

Screenshot 2023-06-06 at 02 25 16

UtkuDalmaz avatar Jun 05 '23 23:06 UtkuDalmaz

Same here

corentios avatar Jun 06 '23 09:06 corentios

I'm wondering if this project is still being maintained, but I'm encountering the same error (and some other libraries are also experiencing the same issue 😟 )

phoenisis avatar Jun 07 '23 12:06 phoenisis

I'm wondering if this project is still being maintained, but I'm encountering the same error (and some other libraries are also experiencing the same issue 😟 )

Might it be a bug in Xcode rather than a code bug?

UtkuDalmaz avatar Jun 08 '23 10:06 UtkuDalmaz

same here (Xcode 15 Beta2) 😿

funsiyuan avatar Jun 23 '23 12:06 funsiyuan

I also discovered the error on xcode 15 beta 2 Hopefully, someone can fix it

nvnthermawan12 avatar Jun 23 '23 18:06 nvnthermawan12

Only fix to build it locally is to delete theses lines in : https://github.com/Yummypets/YPImagePicker/blob/master/Source/Configuration/YPImagePickerConfiguration.swift

/// Migration
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.compression")
  public var videoCompression: String = AVAssetExportPresetHighestQuality
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.fileType")
  public var videoExtension: AVFileType = .mov
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.recordingTimeLimit")
  public var videoRecordingTimeLimit: TimeInterval = 60.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.libraryTimeLimit")
  public var videoFromLibraryTimeLimit: TimeInterval = 60.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.minimumTimeLimit")
  public var videoMinimumTimeLimit: TimeInterval = 3.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.trimmerMaxDuration")
  public var trimmerMaxDuration: Double = 60.0

  @available(iOS, obsoleted: 3.0.0, renamed: "video.trimmerMinDuration")
  public var trimmerMinDuration: Double = 3.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.onlySquare")
  public var onlySquareImagesFromLibrary = false
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.onlySquare")
  public var onlySquareFromLibrary = false
  
  @available(iOS, obsoleted: 3.0.0, renamed: "targetImageSize")
  public var libraryTargetImageSize = YPImageSize.original
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.mediaType")
  public var showsVideoInLibrary = false
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.mediaType")
  public var libraryMediaType = YPlibraryMediaType.photo
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.maxNumberOfItems")
  public var maxNumberOfItems = 1

corentios avatar Jun 23 '23 19:06 corentios

Only fix to build it locally is to delete theses lines in : https://github.com/Yummypets/YPImagePicker/blob/master/Source/Configuration/YPImagePickerConfiguration.swift

/// Migration
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.compression")
  public var videoCompression: String = AVAssetExportPresetHighestQuality
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.fileType")
  public var videoExtension: AVFileType = .mov
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.recordingTimeLimit")
  public var videoRecordingTimeLimit: TimeInterval = 60.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.libraryTimeLimit")
  public var videoFromLibraryTimeLimit: TimeInterval = 60.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.minimumTimeLimit")
  public var videoMinimumTimeLimit: TimeInterval = 3.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.trimmerMaxDuration")
  public var trimmerMaxDuration: Double = 60.0

  @available(iOS, obsoleted: 3.0.0, renamed: "video.trimmerMinDuration")
  public var trimmerMinDuration: Double = 3.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.onlySquare")
  public var onlySquareImagesFromLibrary = false
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.onlySquare")
  public var onlySquareFromLibrary = false
  
  @available(iOS, obsoleted: 3.0.0, renamed: "targetImageSize")
  public var libraryTargetImageSize = YPImageSize.original
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.mediaType")
  public var showsVideoInLibrary = false
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.mediaType")
  public var libraryMediaType = YPlibraryMediaType.photo
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.maxNumberOfItems")
  public var maxNumberOfItems = 1

Doesn't it cause any errors elsewhere?

nvnthermawan12 avatar Jun 23 '23 19:06 nvnthermawan12

Only fix to build it locally is to delete theses lines in : https://github.com/Yummypets/YPImagePicker/blob/master/Source/Configuration/YPImagePickerConfiguration.swift

/// Migration
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.compression")
  public var videoCompression: String = AVAssetExportPresetHighestQuality
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.fileType")
  public var videoExtension: AVFileType = .mov
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.recordingTimeLimit")
  public var videoRecordingTimeLimit: TimeInterval = 60.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.libraryTimeLimit")
  public var videoFromLibraryTimeLimit: TimeInterval = 60.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.minimumTimeLimit")
  public var videoMinimumTimeLimit: TimeInterval = 3.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.trimmerMaxDuration")
  public var trimmerMaxDuration: Double = 60.0

  @available(iOS, obsoleted: 3.0.0, renamed: "video.trimmerMinDuration")
  public var trimmerMinDuration: Double = 3.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.onlySquare")
  public var onlySquareImagesFromLibrary = false
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.onlySquare")
  public var onlySquareFromLibrary = false
  
  @available(iOS, obsoleted: 3.0.0, renamed: "targetImageSize")
  public var libraryTargetImageSize = YPImageSize.original
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.mediaType")
  public var showsVideoInLibrary = false
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.mediaType")
  public var libraryMediaType = YPlibraryMediaType.photo
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.maxNumberOfItems")
  public var maxNumberOfItems = 1

Doesn't it cause any errors elsewhere?

I've never used these variables, but if you have, I'd advise you to check whether you use them in your project.

corentios avatar Jun 23 '23 20:06 corentios

Only fix to build it locally is to delete theses lines in : https://github.com/Yummypets/YPImagePicker/blob/master/Source/Configuration/YPImagePickerConfiguration.swift

/// Migration
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.compression")
  public var videoCompression: String = AVAssetExportPresetHighestQuality
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.fileType")
  public var videoExtension: AVFileType = .mov
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.recordingTimeLimit")
  public var videoRecordingTimeLimit: TimeInterval = 60.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.libraryTimeLimit")
  public var videoFromLibraryTimeLimit: TimeInterval = 60.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.minimumTimeLimit")
  public var videoMinimumTimeLimit: TimeInterval = 3.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "video.trimmerMaxDuration")
  public var trimmerMaxDuration: Double = 60.0

  @available(iOS, obsoleted: 3.0.0, renamed: "video.trimmerMinDuration")
  public var trimmerMinDuration: Double = 3.0
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.onlySquare")
  public var onlySquareImagesFromLibrary = false
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.onlySquare")
  public var onlySquareFromLibrary = false
  
  @available(iOS, obsoleted: 3.0.0, renamed: "targetImageSize")
  public var libraryTargetImageSize = YPImageSize.original
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.mediaType")
  public var showsVideoInLibrary = false
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.mediaType")
  public var libraryMediaType = YPlibraryMediaType.photo
  
  @available(iOS, obsoleted: 3.0.0, renamed: "library.maxNumberOfItems")
  public var maxNumberOfItems = 1

Doesn't it cause any errors elsewhere?

I've never used these variables, but if you have, I'd advise you to check whether you use them in your project.

I tried this one and everything okay

  @available(iOS, obsoleted: 3.0.0, renamed: "video.compression")
    public var videoCompression: String {
        get {
            return AVAssetExportPresetHighestQuality
        }
    }
    
    @available(iOS, obsoleted: 3.0.0, renamed: "video.fileType")
    public var videoExtension: AVFileType {
        get {
            return .mov
        }
    }
    
    @available(iOS, obsoleted: 3.0.0, renamed: "video.recordingTimeLimit")
    public var videoRecordingTimeLimit: TimeInterval {
        get {
            return 60.0
        }
    }
    
    @available(iOS, obsoleted: 3.0.0, renamed: "video.libraryTimeLimit")
    public var videoFromLibraryTimeLimit: TimeInterval {
        get {
            return 60.0
        }
    }
    
     @available(iOS, obsoleted: 3.0.0, renamed: "video.minimumTimeLimit")
    public var videoMinimumTimeLimit: TimeInterval {
        get {
            return 3.0
        }
    }
    
    @available(iOS, obsoleted: 3.0.0, renamed: "video.trimmerMaxDuration")
    public var trimmerMaxDuration: Double {
        get {
            return 60.0
        }
    }

    @available(iOS, obsoleted: 3.0.0, renamed: "video.trimmerMinDuration")
    public var trimmerMinDuration: Double {
        get {
            return 3.0
        }
    }
    
    @available(iOS, obsoleted: 3.0.0, renamed: "library.onlySquare")
    public var onlySquareImagesFromLibrary: Bool {
        get {
            return false
        }
    }
    
    @available(iOS, obsoleted: 3.0.0, renamed: "library.onlySquare")
    public var onlySquareFromLibrary: Bool {
        get {
            return false
        }
    }
    
    @available(iOS, obsoleted: 3.0.0, renamed: "targetImageSize")
    public var libraryTargetImageSize: Any {
        get {
            return YPImageSize.original
        }
    }
    
    @available(iOS, obsoleted: 3.0.0, renamed: "library.mediaType")
    public var showsVideoInLibrary: Bool {
        get {
            return false
        }
    }
    
    @available(iOS, obsoleted: 3.0.0, renamed: "library.mediaType")
    public var libraryMediaType: Any {
        get {
            return YPlibraryMediaType.photo
        }
    }
    
    @available(iOS, obsoleted: 3.0.0, renamed: "library.maxNumberOfItems")
    public var maxNumberOfItems: Int {
        get {
            return 1
        }
    } 

nvnthermawan12 avatar Jun 24 '23 17:06 nvnthermawan12

For all of you trying to compile on XCode 15, I made a fork of this for now until we get changes, on https://github.com/LawrenceNorman/YPImagePicker.git To use it, you'll need to remove your YPImagePicker via swift package manager and then use my forked one and it should work. Here are the steps and replacing: Remove the Existing YPImagePicker -Open your Xcode project. -Select your project file in the Project Navigator. -In the middle pane, select your application target, then go to the "Swift Packages" tab. -You'll see YPImagePicker in the list of added packages. Select it and click the minus ("-") button. Add Your Forked Repository as a Dependency After you've removed the original YPImagePicker, go to File -> Swift Packages -> Add Package Dependency via: https://github.com/LawrenceNorman/YPImagePicker.git

LawrenceNorman avatar Jun 27 '23 17:06 LawrenceNorman

Fixed here https://github.com/Yummypets/YPImagePicker/commit/4ad09560321182b73ed415c543a77bc83b80a3f2 A temporary way for use: pod 'YPImagePicker', :git => 'https://github.com/Yummypets/YPImagePicker.git', :commit => '4ad09560321182b73ed415c543a77bc83b80a3f2'

NikKovIos avatar Sep 21 '23 12:09 NikKovIos

Fixed here 4ad0956 A temporary way for use: pod 'YPImagePicker', :git => 'https://github.com/Yummypets/YPImagePicker.git', :commit => '4ad09560321182b73ed415c543a77bc83b80a3f2'

not compatible with minimum deployment ios 11

mauldyputra avatar Sep 27 '23 04:09 mauldyputra