DavBfr / dart_pdf

Pdf creation module for dart/flutter
https://pub.dev/packages/pdf
Apache License 2.0
1.36k stars 593 forks source link

No named parameter with the name 'size' Build process failed on windows #1593

Open walulyafrancis opened 4 months ago

walulyafrancis commented 4 months ago

I have tried to build windows app using version 5.11.1 but i keep geting this error which appears to be caused by a breaking change in flutter version 3.19.0.5-5.0.pre.45 according to issue #141562 at https://github.com/flutter/flutter/issues/141562 from RenderView ViewConfiguration(), parameter 'size ' is missing from the constructor and it has been replaced with final renderView = RenderView( view: lastView, child: RenderPositionedBox(alignment: Alignment.center, child: repaintBoundary), configuration: ViewConfiguration( physicalConstraints: BoxConstraints.tight(logicalSize) * lastView.devicePixelRatio, logicalConstraints: BoxConstraints.tight(logicalSize), devicePixelRatio: lastView.devicePixelRatio, ), );

or

ViewConfiguration(
          constraints: ui.ViewConstraints.tight(Size(
              computedConstraints.maxWidth, computedConstraints.maxHeight)),
          devicePixelRatio: view.devicePixelRatio)

in my case since am using Flutter version 3.18.0-7.0.pre.59 on channel master , i tried changing that from cache and it worked Here is my error message


../../../../AppData/Local/Pub/Cache/hosted/pub.dev/printing-5.11.1/lib/src/widget_wrapper.dart(173,11): error GC6690633: No named parameter with the name 'size'. [C:\Users\HP\OneDrive\Documents\FlutterDev\demo_printer\build\windows\x64\flutter\flutter_assemble.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB8066: Custom build for 'C:\Users\HP\OneDrive\Documents\FlutterDev\demo_printer\build\windows\x64\CMakeFiles\27c20b21665d2e6f7756a89c0f630592\flutter_windows.dll.rule;C:\Users\HP\OneDrive\Documents\FlutterDev\demo_printer\build\windows\x64\CMakeFiles\38aaa44b608238b8a857ab86b5171a1a\flutter_assemble.rule' exited with code 1. [C:\Users\HP\OneDrive\Documents\FlutterDev\demo_printer\build\windows\x64\flutter\flutter_assemble.vcxproj]
Error: Build process failed.

here is my flutter doctor -v

[√] Flutter (Channel master, 3.18.0-7.0.pre.59, on Microsoft Windows [Version 10.0.22621.3007], locale en-UG) • Flutter version 3.18.0-7.0.pre.59 on channel master at C:\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision a9ae39df67 (8 weeks ago), 2023-12-11 01:17:19 -0500 • Engine revision 7eb6b7cab6 • Dart version 3.3.0 (build 3.3.0-215.0.dev) • DevTools version 2.30.0

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2) • Android SDK at C:\Users\HP\AppData\Local\Android\sdk • Platform android-34, build-tools 33.0.2 • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619) • All Android licenses accepted.

[√] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.3) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.5.33516.290 • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2022.1) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)

[√] VS Code (version 1.86.0) • VS Code at C:\Users\HP\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.83.20240201

[√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22621.3007] • Chrome (web) • chrome • web-javascript • Google Chrome 121.0.6167.140 • Edge (web) • edge • web-javascript • Microsoft Edge 121.0.2277.98

[√] Network resources • All expected network resources are available.

Keatr0n commented 2 weeks ago

+1

DavBfr commented 2 weeks ago

Please use the stable version of Flutter.

Keatr0n commented 2 weeks ago

I do. Flutter 3.22.1 • channel stable

plokko commented 1 week ago

I can confirm the bug: a Flutter downgrade from Flutter (Channel stable, 3.22.2, on Microsoft Windows [Versione 10.0.22631.3737], locale it-IT) to v3.19.6 seems to have fixed the issue. Please do fix compatibility issue with the latest stable Flutter version.

DavBfr commented 1 week ago

Run a flutter clean and flutter pub upgrade to fix the issue.

plokko commented 1 week ago

Run a flutter clean and flutter pub upgrade to fix the issue.

Already tried multiple flutter clean, dart pub clean and flutter pub upgrade but did not solve the issue. I tried upgrading again to Flutter v3.22.2, run flutter clean and dart pub upgrade and got the same error:

../../AppData/Local/Pub/Cache/hosted/pub.dev/pdf_widget_wrapper-1.0.3/lib/src/widget_wrapper.dart:173:11: Error: No named parameter with the name 'size'.
          size: Size(
          ^^^^
/C:/lib/flutter/packages/flutter/lib/src/rendering/view.dart:28:9: Context: Found this candidate, but the arguments don't match.
  const ViewConfiguration({
        ^^^^^^^^^^^^^^^^^
Guilherme-ctrl commented 1 week ago

Any solutions yet?

conormvickers commented 4 days ago

No promises but after fiddling with flutter cleans and pub gets flutter pub upgrade finally updated > pdf_widget_wrapper 1.0.4 (was 1.0.3)

This particular error went away, hope that helps someone (building for android on windows machine)