Closed engineer-ece closed 1 year ago
I am facing the same exact issue with version 20.4.48
(latest currently). Is this plugin version working for anyone?
I can confirm this issue with the latest version.
I tried switching between iOS and Android and clearing my pub cache via:
dart pub cache clean
Nothing helped. The error log is quite long, maybe it helps when I post the full error:
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_core-20.4.48/lib/src/widgets/interactive_scroll_viewer.dart:59:9: Error: Type 'PanAxis' not found.
final PanAxis panAxis;
^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_core-20.4.48/lib/src/widgets/interactive_scroll_viewer.dart:15:22: Error: Undefined name 'PanAxis'.
this.panAxis = PanAxis.free,
^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.4.48/lib/src/pdfviewer.dart:1016:54: Error: Method 'readState' cannot be called on 'PageStorageBucket?' because it is potentially null.
- 'PageStorageBucket' is from 'package:flutter/src/widgets/page_storage.dart' ('../../../Development/flutter/packages/flutter/lib/src/widgets/page_storage.dart').
Try calling using ?. instead.
final dynamic offset = PageStorage.of(context).readState(context);
^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.4.48/lib/src/pdfviewer.dart:1020:12: Error: Method 'readState' cannot be called on 'PageStorageBucket?' because it is potentially null.
- 'PageStorageBucket' is from 'package:flutter/src/widgets/page_storage.dart' ('../../../Development/flutter/packages/flutter/lib/src/widgets/page_storage.dart').
Try calling using ?. instead.
.readState(context, identifier: 'zoomLevel_${widget.key}');
^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.4.48/lib/src/pdfviewer.dart:3244:35: Error: Method 'writeState' cannot be called on 'PageStorageBucket?' because it is potentially null.
- 'PageStorageBucket' is from 'package:flutter/src/widgets/page_storage.dart' ('../../../Development/flutter/packages/flutter/lib/src/widgets/page_storage.dart').
Try calling using ?. instead.
PageStorage.of(context).writeState(
^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.4.48/lib/src/pdfviewer.dart:3272:35: Error: Method 'writeState' cannot be called on 'PageStorageBucket?' because it is potentially null.
- 'PageStorageBucket' is from 'package:flutter/src/widgets/page_storage.dart' ('../../../Development/flutter/packages/flutter/lib/src/widgets/page_storage.dart').
Try calling using ?. instead.
PageStorage.of(context).writeState(
^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_core-20.4.48/lib/src/widgets/interactive_scroll_viewer.dart:59:9: Error: 'PanAxis' isn't a type.
final PanAxis panAxis;
^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_core-20.4.48/lib/src/widgets/interactive_scroll_viewer.dart:299:9: Error: No named parameter with the name 'panAxis'.
panAxis: widget.panAxis,
^^^^^^^
../../../Development/flutter/packages/flutter/lib/src/widgets/interactive_viewer.dart:61:3: Context: Found this candidate, but the arguments don't match.
InteractiveViewer({
^^^^^^^^^^^^^^^^^
../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdf-20.4.48/lib/src/pdf/implementation/forms/pdf_xfdf_document.dart:38:35: Error: The argument type 'String?' can't be assigned to the parameter type 'Object' because 'String?' is nullable and 'Object' isn't.
- 'Object' is from 'dart:core'.
builder.attribute('href', _pdfFilePath);
^
FAILURE: Build failed with an exception.
* Where:
Script '/Users/USER/Development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1159
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/USER/Development/flutter/bin/flutter'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
I am on a M1 MacBook Pro 2020 with MacOS Ventura 13.0.1.
A fix would be highly appreciated!
Kind regards, Adam
FYI: Duplicate of #1067 and #1064 .
Solution proposed in #1064 is to upgrade the flutter SDK by running
flutter upgrade
This worked for me and I am able to now compile my iOS app with the syncfusion SfPDFViewer widget! But before this, I broke my flutter installation and it took me an hour to google for the fixes, so beware of that!
I do not remember all of the commands, but among these are the following:
flutter channel stable
dart
and flutter
executables by running echo $PATH
. Otherwise you will get an error message about "Cannot extract a non-Windows file path from a file URI with an authority".flutter pub outdated
and flutter pub upgrade
and then upgrading flutter again using flutter channel stable
and flutter upgrade
. Otherwise you get an error message like "The method 'File.create' doesn't have the named parameter 'exclusive' of overridden method".flutter clean
, rm -Rf ios/Pods
, rm -Rf ios/.symlinks
, rm -Rf ios/Flutter/Flutter.framework
, rm -Rf ios/Flutter/Flutter.podspec
, flutter pub get
, cd ios
, arch -x86_64 pod install
(specifically M1 MacOS!), flutter build ios
and flutter run
. Otherwise you get the error message "error running pod install".It was quite chaotic and in retrospective I think it would have been easier to just re-install flutter. However, I did not test that.
I hope that this will help you resolving your issues regarding the most recent release of the SF flutter widget.
Kind regards, Adam
Upgrading flutter is way too much hassle. I don't want to break existing dependencies and open another can of worms.
Would either go for a different library or use a version of this one which is compatiable with my flutter version ( [✓] Flutter (Channel beta, 3.7.0-1.3.pre, on macOS 12.5 21G72 darwin-x64, locale en-GB)
)
Currently trying to find which version will work for my flutter.
syncfusion_flutter_core: 20.3.59 syncfusion_flutter_pdf: 20.3.59 syncfusion_flutter_pdfviewer: 20.3.59
This is working, thank you sir, i checked. In new version only throwing bug in above
We found that the problem is due to the older version of the xml package being referred to in your project. Recently, the XmlBuilder attribute value API has been updated from non-nullable to nullable type; you can refer to the following API reference for further details.
So, we request you to update your pub cache by using the following command to resolve the issue.
dart pub cache add xml --version "6.2.2"
You can refer https://dart.dev/tools/pub/cmd/pub-cache for more details.
@abehbatre This worked for me. Thanks, a lot.
temporary fix: downgrade to:
# syncfusion syncfusion_flutter_core: 20.3.59 syncfusion_flutter_pdf: 20.3.59 syncfusion_flutter_pdfviewer: 20.3.59
+1
it don't working for me.
temporary fix: downgrade to:
# syncfusion syncfusion_flutter_core: 20.3.59 syncfusion_flutter_pdf: 20.3.59 syncfusion_flutter_pdfviewer: 20.3.59
This will help https://www.youtube.com/watch?v=gAUVz0U7eyA
The reported problem has been resolved in the latest versions.
/D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdf-20.4.48/lib/src/pdf/implementation/forms/pdf_xfdf_document.dart:38:35: Error: The argument type 'String?' can't be assigned to the parameter type 'Object' because 'String?' is nullable and 'Object' isn't.