ko2ic / image_downloader

Flutter plugin that downloads images and movies on the Internet and saves to Photo Library on iOS or specified directory on Android.
https://pub.dartlang.org/packages/image_downloader#-readme-tab-
MIT License
92 stars 116 forks source link

jpegData has been renamed to UIImageJPEGRepresentation #33

Closed xainpro closed 5 years ago

xainpro commented 5 years ago

Build failed because of following error : (

error: 'jpegData(compressionQuality:)' has been renamed to 'UIImageJPEGRepresentation(::)' let jpegData = newImage.jpegData(compressionQuality: 1.0)! ^~~~ UIImageJPEGRepresentation UIKit.UIImage:60:17: note: 'jpegData(compressionQuality:)' was introduced in Swift 4.2 public func jpegData(compressionQuality: CGFloat) -> Data?

ko2ic commented 5 years ago

@xainpro I confirmed, but it is working properly. Please do flutter doctor -v and paste.

In addition, are you using old cocoapods?

xainpro commented 5 years ago
[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.14.5 18F132, locale en-DE)
    • Flutter version 1.7.8+hotfix.3 at /Volumes/Zain/dev-tools/flutter
    • Framework revision b712a172f9 (6 days ago), 2019-07-09 13:14:38 -0700
    • Engine revision 54ad777fd2
    • Dart version 2.4.0

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/m8903/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • CocoaPods version 1.6.1

[✓] iOS tools - develop for iOS devices
    • ios-deploy 1.9.4

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 35.3.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] VS Code (version 1.35.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.2.0

It all looks good but Xcode build fail.

COCOAPODS: 1.6.1

xainpro commented 5 years ago

Gradle also fail :(

../pub.dartlang.org/image_downloader-0.16.0/android/src/main/kotlin/com/ko2ic/imagedownloader/ImageDownloaderPlugin.kt: (333, 41): Unresolved reference: random

ko2ic commented 5 years ago

@xainpro I tried various versions, but no problems have occurred. It looks like you have a problem with your app.

Did you confirm with the example in this Plugin?

xainpro commented 5 years ago

I tried out the example it worked for me so i compare the build the difference was my project was created with kotlin and swift switch so i had problem i created new project with classical stuff java and objc and it works. So closing this issue but it would have impact on future release maybe. Thanks for quick support

ko2ic commented 5 years ago

@xainpro If so, the following may be the cause. please try it.

https://github.com/ko2ic/image_downloader/wiki#your-appdelegate-is-the-case-of-objective-c

ko2ic commented 5 years ago

@xainpro I fixed the swift version of plug-in to 4.2. Please try v0.16.2.