esys-flutter-share
esys-flutter-share copied to clipboard
Error while sharing in iPad
Describe the bug When I want to share in iPad, it throw exception. And nothing happen
To Reproduce Execute app in iPad and see the exception
Smartphone (please complete the following information):
- OS: iPad IOS 14.3
Additional context Exception log:
2021-01-25 09:53:53.182092-0800 Runner[19490:117428] [LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x60000108bbb0 LPLinkView:0x7f807473e690.leading == UILayoutGuide:0x600000abbb80'UIViewLayoutMarginsGuide'.leading (active)>",
"<NSLayoutConstraint:0x60000108ba20 H:[LPLinkView:0x7f807473e690]-(59)-| (active, names: '|':_UIActivityContentTitleView:0x7f807473d080 )>",
"<NSLayoutConstraint:0x600001091b30 H:|-(0)-[_UIActivityContentTitleView:0x7f807473d080] (active, names: '|':_UINavigationBarContentView:0x7f8074460df0 )>",
"<NSLayoutConstraint:0x600001091e00 _UIActivityContentTitleView:0x7f807473d080.trailing == _UINavigationBarContentView:0x7f8074460df0.trailing (active)>",
"<NSLayoutConstraint:0x600001093d90 'UIView-Encapsulated-Layout-Width' _UINavigationBarContentView:0x7f8074460df0.width == 0 (active)>",
"<NSLayoutConstraint:0x60000108bac0 'UIView-leftMargin-guide-constraint' H:|-(16)-[UILayoutGuide:0x600000abbb80'UIViewLayoutMarginsGuide'](LTR) (active, names: '|':_UIActivityContentTitleView:0x7f807473d080 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000108bbb0 LPLinkView:0x7f807473e690.leading == UILayoutGuide:0x600000abbb80'UIViewLayoutMarginsGuide'.leading (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
Similar issue: https://github.com/flutter/flutter/issues/50764 My Code:
Share.file(trans('share_chart'), "$name.$extension", bytes, type,text: 'Share your chart');
With this https://pub.dev/packages/share it working:
var path = (await getApplicationDocumentsDirectory()).path + "/file";
await File(path).writeAsBytes(bytes);
s.Share.shareFiles([path],
mimeTypes: [type],
text: 'Share your chart',
subject: trans('share_chart'));
We experience the same issue. And actually Apple rejected our update due to this bug :/
@elihaidv @Desno365 iPad related issues are likely fixed in pull requests submitted to this repo. Just fork the repo and apply the fixes.
@Desno365 Applying this pull request to my forked repo fixed the issue.
https://pub.dev/packages/vocsy_esys_flutter_share
Use this Package its working on latest version