ScerIO/packages.flutter

Failed to build project depending on native_pdf_renderer with Flutter 3

ethael opened this issue · 12 comments

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

i'm running into same issue

I am also blocked by this issue.

Blocked by this issue as well :(

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

My build is broken as well.

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

Switching to pdfx solved the issue. Thanks

I'm using pdfx and still having this bug 😅

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

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.

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

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...

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.