rgodlontonshaw / flutter_image_gallery

A Flutter plugin to assist with easy access and display to the native iOS and Android image gallery
Other
2 stars 1 forks source link

iOS build failed #1

Open dimityrivanov opened 4 years ago

dimityrivanov commented 4 years ago

Xcode's output: ↳ /Users/dimitarivanov/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_gallery-1.0.6/ios/Classes/SwiftFlutterImageGalleryPlugin.swift:5:45: error: expected type public class SwiftFlutterImageGalleryPlugin:: NSObject, FlutterPlugin { ^ /Users/dimitarivanov/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_gallery-1.0.6/ios/Classes/SwiftFlutterImageGalleryPlugin.swift:5:45: error: expected '{' in class public class SwiftFlutterImageGalleryPlugin:: NSObject, FlutterPlugin { ^ /Users/dimitarivanov/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_gallery-1.0.6/ios/Classes/SwiftFlutterImageGalleryPlugin.swift:5:71: error: top-level statement cannot begin with a closure expression public class SwiftFlutterImageGalleryPlugin:: NSObject, FlutterPlugin { ^ /Users/dimitarivanov/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_gallery-1.0.6/ios/Classes/SwiftFlutterImageGalleryPlugin.swift:6:5: error: attribute 'public' can only be used in a non-local scope public static func register(with registrar: FlutterPluginRegistrar) { ^ /Users/dimitarivanov/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_gallery-1.0.6/ios/Classes/SwiftFlutterImageGalleryPlugin.swift:6:19: error: static methods may only be declared on a type public static func register(with registrar: FlutterPluginRegistrar) {



    /Users/dimitarivanov/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_gallery-1.0.6/ios/Classes/SwiftFlutterImageGalleryPlugin.swift:12:5: error: attribute 'public' can only be used in a non-local scope
        public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
        ^
    /Users/dimitarivanov/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_gallery-1.0.6/ios/Classes/SwiftFlutterImageGalleryPlugin.swift:5:71: error: expressions are not allowed at the top level
    public class SwiftFlutterImageGalleryPlugin:: NSObject, FlutterPlugin {
                                                                          ^
    /Users/dimitarivanov/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_gallery-1.0.6/ios/Classes/SwiftFlutterImageGalleryPlugin.swift:8:24: error: use of unresolved identifier 'SwiftFlutterGallaryPlugin'
            let instance = SwiftFlutterGallaryPlugin()
                           ^~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/dimitarivanov/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_gallery-1.0.6/ios/Classes/SwiftFlutterImageGalleryPlugin.swift:45:45: error: 'UIImageJPEGRepresentation' has been replaced by instance method 'UIImage.jpegData(compressionQuality:)'
                                    imageData = UIImageJPEGRepresentation(image!, 0.8)
                                                ^~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
                                                image!.jpegData                   compressionQuality: 
    UIKit.UIImageJPEGRepresentation:2:13: note: 'UIImageJPEGRepresentation' was obsoleted in Swift 3
    public func UIImageJPEGRepresentation(_ image: UIImage, _ compressionQuality: CGFloat) -> Data?
                ^
    /Users/dimitarivanov/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_gallery-1.0.6/ios/Classes/SwiftFlutterImageGalleryPlugin.swift:48:45: error: 'UIImagePNGRepresentation' has been replaced by instance method 'UIImage.pngData()'
                                    imageData = UIImagePNGRepresentation(image!)
                                                ^~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
                                                image!.pngData           
    UIKit.UIImagePNGRepresentation:2:13: note: 'UIImagePNGRepresentation' was obsoleted in Swift 3
    public func UIImagePNGRepresentation(_ image: UIImage) -> Data?
                ^
    /Users/dimitarivanov/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_gallery-1.0.6/ios/Classes/SwiftFlutterImageGalleryPlugin.swift:5:71: error: closure expression is unused
    public class SwiftFlutterImageGalleryPlugin:: NSObject, FlutterPlugin {
                                                                          ^
    /Users/dimitarivanov/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_gallery-1.0.6/ios/Classes/SwiftFlutterImageGalleryPlugin.swift:5:71: note: did you mean to use a 'do' statement?
    public class SwiftFlutterImageGalleryPlugin:: NSObject, FlutterPlugin {
                                                                          ^
                                                                          do 
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 6s.

Any idea how to fix it ?
rupalitomar5 commented 4 years ago

I am also facing same issue. Can you please give me suggestions

tearhear18 commented 4 years ago

yes same issue here

sayurikunugi commented 4 years ago

same issue.

ahhmino commented 2 years ago

Any workarounds?