Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error in native_pdf_renderer plugin on Swift 4.2 #7

Closed
stenionobresem opened this issue Jun 15, 2019 · 1 comment
Closed

Build error in native_pdf_renderer plugin on Swift 4.2 #7

stenionobresem opened this issue Jun 15, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@stenionobresem
Copy link

Package name
native_pdf_renderer v1.3.0+1

Describe the bug

=== BUILD TARGET native_pdf_renderer OF PROJECT Pods WITH CONFIGURATION Release ===
/Users/escolarmanager/work/flutter_plugins_pdf/packages/native_pdf_renderer/ios/Classes/document/Page.swift:59:30: error: 'pngData()' has been renamed to
'UIImagePNGRepresentation(_:)'
data = image.pngData() as Data?
^~~~~~~
UIImagePNGRepresentation
UIKit.UIImage:58:17: note: 'pngData()' was introduced in Swift 4.2
public func pngData() -> Data?

To Reproduce
Steps to reproduce the behavior:

  1. Create a new flutter project;
  2. Adds native_pdf_renderer v1.3.0+1 plugin to pubspec.yaml
  3. Run flutter build ios command
  4. See error

Expected behavior
Successful build

Smartphone (please complete the following information):

  • MAC OS Mojave 10.14.5
  • XCODE Version 10.1 (10B61)
  • Swift 4.2

Additional context
I was replaced the 59 line of Page.swift file and the build works!!!

original
data = image.pngData() as Data?

suggestion
data = UIImagePNGRepresentation(image)

Could you please publish the correction in pub.dev?

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants