ScerIO / packages.flutter

👨‍💻 Plugins and packages for Flutter framework
https://pub.dev/publishers/serge.software/packages
MIT License
461 stars 453 forks source link

Failed to build project depending on native_pdf_renderer with Flutter 3 #298

Open ethael opened 2 years ago

ethael commented 2 years ago

Buiild error output:

NativePdfRendererPlugin.kt: (124, 29): Type mismatch: inferred type is String? but String was expected NativePdfRendererPlugin.kt: (138, 25): Type mismatch: inferred type is String? but String was expected FAILURE: Build failed with an exception.

Flutter doctor: [✓] Flutter (Channel stable, 3.0.0, on Gentoo/Linux 5.16.10-gentoo-dist, locale en_US.utf8) [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [✓] Chrome - develop for the web [✓] Linux toolchain - develop for Linux desktop [✓] Android Studio (version 2021.1) [✓] IntelliJ IDEA Ultimate Edition (version 2021.2) [✓] Connected device (3 available) [✓] HTTP Host Availability

mato7511 commented 2 years ago

i'm running into same issue

MartinHlavna commented 2 years ago

I am also blocked by this issue.

JurajMlich commented 2 years ago

Blocked by this issue as well :(

matejhocevar commented 2 years ago

Same here, I needed to revert the whole upgrade. Let me know if there is something that I can help with.

tim-isonsolutions commented 2 years ago

My build is broken as well.

Can you provide at least a "ballpark" ETA so we can plan our road forward. Thanks!!

tim-isonsolutions commented 2 years ago

Switching to pdfx solved the issue. Thanks

Caeruleo commented 2 years ago

I'm using pdfx and still having this bug 😅

griff88 commented 2 years ago

Having the same issue as well... Adding pdfx does not work either

Caeruleo commented 2 years ago

I discovered that in my case the problem was that I use a library that has as transitive dependency and old version of native_pdf_renderer (4.X.X) https://pub.dev/packages/thumbnailer. Adding

native_pdf_renderer: ^5.0.0+1 
 pdfx: ^2.0.1+2

on dependency_overrides fixed my problem, it seems a bit risky but everything seems to work fine. Last versions of native_pdf_renderer and pdfx seems to be able to compile fine with flutter 3, check if you've any transitive dependency that uses an older one. I searched for the old dependency on the pubspec.lock and then I used flutter pub deps to see the dependency graph.

Hope it helps anyone.

ethael commented 2 years ago

@Caeruleo FYI: https://github.com/4Q-s-r-o/thumbnailer today released new version with updated dependencies.

hydev777 commented 2 years ago

I am having the same issue, I have not the package in my dependencies however some package is using it and is blocking the Android app from running...

hydev777 commented 2 years ago

The problem has been solved, the dependency thumbnailer was using an old version (version 4) of native_pdf_renderer as mentioned by @Caeruleo, so we find out we were not using that package and proceed to deleted.