Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ios crash when click textbox #85

Open
alikopasa opened this issue May 25, 2018 · 9 comments
Open

Ios crash when click textbox #85

alikopasa opened this issue May 25, 2018 · 9 comments

Comments

@alikopasa
Copy link

Hello, I have a page that has textbox.
when i try to edit textbox, app craashing with below error.
can you help me please?

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. 
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 

(
"<NSAutoresizingMaskLayoutConstraint:0x604000281220 h=-&- v=-&- _UIToolbarContentView:0x7f857b74a620.width == UIToolbar:0x7f857b5474a0.width (active)>",
"<NSLayoutConstraint:0x6000000963f0 H:|-(0)-[_UIButtonBarStackView:0x7f857b74bbf0] (active, names: '|':_UIToolbarContentView:0x7f857b74a620 )>",
"<NSLayoutConstraint:0x6000000966c0 _UIButtonBarStackView:0x7f857b74bbf0.trailing == _UIToolbarContentView:0x7f857b74a620.trailing + 8 (active)>",
"<NSLayoutConstraint:0x600000280550 H:|-(0)-[_UIModernBarButton:0x7f857b603a50] (active, names: '|':_UIButtonBarButton:0x7f857b762b20 )>",
"<NSLayoutConstraint:0x6000002805a0 H:[_UIModernBarButton:0x7f857b603a50]-(>=8)-| (active, names: '|':_UIButtonBarButton:0x7f857b762b20 )>",
"<NSLayoutConstraint:0x600000280e10 H:|-(>=5)-[_UIModernBarButton:0x7f857b763f40] (active, names: '|':_UIButtonBarButton:0x7f857b7638d0 )>",
"<NSLayoutConstraint:0x600000280e60 H:[_UIModernBarButton:0x7f857b763f40]-(>=5)-| (active, names: '|':_UIButtonBarButton:0x7f857b7638d0 )>",
"<NSLayoutConstraint:0x60400008ad70 H:|-(8)-[_UIModernBarButton:0x7f857b56cea0'Done'] (active, names: '|':_UIButtonBarButton:0x7f857b764980 )>",
"<NSLayoutConstraint:0x604000280b90 H:[_UIModernBarButton:0x7f857b56cea0'Done']-(0)-| (active, names: '|':_UIButtonBarButton:0x7f857b764980 )>",
"<NSLayoutConstraint:0x604000280f50 'UISV-canvas-connection' UILayoutGuide:0x6040003af340'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x7f857b762b20.leading (active)>",
"<NSLayoutConstraint:0x604000281860 'UISV-canvas-connection' UILayoutGuide:0x6040003af340'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x7f857b764980.trailing (active)>",
"<NSLayoutConstraint:0x604000281720 'UISV-spacing' H:[_UIButtonBarButton:0x7f857b762b20]-(0)-[UIView:0x7f857b7636e0] (active)>",
"<NSLayoutConstraint:0x6040002819a0 'UISV-spacing' H:[UIView:0x7f857b7636e0]-(0)-[_UIButtonBarButton:0x7f857b7638d0] (active)>",
"<NSLayoutConstraint:0x604000281a40 'UISV-spacing' H:[_UIButtonBarButton:0x7f857b7638d0]-(0)-[UIView:0x7f857b764790] (active)>",
"<NSLayoutConstraint:0x604000281ae0 'UISV-spacing' H:[UIView:0x7f857b764790]-(0)-[_UIButtonBarButton:0x7f857b764980] (active)>",
"<NSLayoutConstraint:0x604000281ef0 'UIView-Encapsulated-Layout-Width' UIToolbar:0x7f857b5474a0.width == 0 (active)>",
"<NSLayoutConstraint:0x604000094e60 'UIView-leftMargin-guide-constraint' H:|-(0)-UILayoutGuide:0x6040003af340'UIViewLayoutMarginsGuide' (active, names: '|':_UIButtonBarStackView:0x7f857b74bbf0 )>",
"<NSLayoutConstraint:0x604000096300 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x6040003af340'UIViewLayoutMarginsGuide']-(0)-|(LTR) (active, names: '|':_UIButtonBarStackView:0x7f857b74bbf0 )>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x6000002805a0 H:[_UIModernBarButton:0x7f857b603a50]-(>=8)-| (active, names: '|':_UIButtonBarButton:0x7f857b762b20 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
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.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x604000281220 h=-&- v=-&- _UIToolbarContentView:0x7f857b74a620.width == UIToolbar:0x7f857b5474a0.width (active)>",
"<NSLayoutConstraint:0x6000000963f0 H:|-(0)-[_UIButtonBarStackView:0x7f857b74bbf0] (active, names: '|':_UIToolbarContentView:0x7f857b74a620 )>",
"<NSLayoutConstraint:0x6000000966c0 _UIButtonBarStackView:0x7f857b74bbf0.trailing == _UIToolbarContentView:0x7f857b74a620.trailing + 8 (active)>",
"<NSLayoutConstraint:0x600000280e10 H:|-(>=5)-[_UIModernBarButton:0x7f857b763f40] (active, names: '|':_UIButtonBarButton:0x7f857b7638d0 )>",
"<NSLayoutConstraint:0x600000280e60 H:[_UIModernBarButton:0x7f857b763f40]-(>=5)-| (active, names: '|':_UIButtonBarButton:0x7f857b7638d0 )>",
"<NSLayoutConstraint:0x60400008ad70 H:|-(8)-[_UIModernBarButton:0x7f857b56cea0'Done'] (active, names: '|':_UIButtonBarButton:0x7f857b764980 )>",
"<NSLayoutConstraint:0x604000280b90 H:[_UIModernBarButton:0x7f857b56cea0'Done']-(0)-| (active, names: '|':_UIButtonBarButton:0x7f857b764980 )>",
"<NSLayoutConstraint:0x604000280f50 'UISV-canvas-connection' UILayoutGuide:0x6040003af340'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x7f857b762b20.leading (active)>",
"<NSLayoutConstraint:0x604000281860 'UISV-canvas-connection' UILayoutGuide:0x6040003af340'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x7f857b764980.trailing (active)>",
"<NSLayoutConstraint:0x604000281720 'UISV-spacing' H:[_UIButtonBarButton:0x7f857b762b20]-(0)-[UIView:0x7f857b7636e0] (active)>",
"<NSLayoutConstraint:0x6040002819a0 'UISV-spacing' H:[UIView:0x7f857b7636e0]-(0)-[_UIButtonBarButton:0x7f857b7638d0] (active)>",
"<NSLayoutConstraint:0x604000281a40 'UISV-spacing' H:[_UIButtonBarButton:0x7f857b7638d0]-(0)-[UIView:0x7f857b764790] (active)>",
"<NSLayoutConstraint:0x604000281ae0 'UISV-spacing' H:[UIView:0x7f857b764790]-(0)-[_UIButtonBarButton:0x7f857b764980] (active)>",
"<NSLayoutConstraint:0x604000281ef0 'UIView-Encapsulated-Layout-Width' UIToolbar:0x7f857b5474a0.width == 0 (active)>",
"<NSLayoutConstraint:0x604000094e60 'UIView-leftMargin-guide-constraint' H:|-(0)-UILayoutGuide:0x6040003af340'UIViewLayoutMarginsGuide' (active, names: '|':_UIButtonBarStackView:0x7f857b74bbf0 )>",
"<NSLayoutConstraint:0x604000096300 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x6040003af340'UIViewLayoutMarginsGuide']-(0)-|(LTR) (active, names: '|':_UIButtonBarStackView:0x7f857b74bbf0 )>"
)

@jadeboer
Copy link

Same issue experienced for me - tap on a input field; when you'd expect the OSK to show, causes a crash on iOS.

@JannieT
Copy link

JannieT commented Apr 25, 2019

I'm not seeing this. iPhone 5s, iOS 12.2, Plugin 0.3.3

@devashish-patel
Copy link

+1 - Same issue

@hcaz
Copy link

hcaz commented Oct 1, 2019

Hi,

I wanted to add some more information to this, since I still seem to be experiencing it but only in a simulator, on a real device the plugin works as expected with the same app and code.

Pretty sure issue #193, #281, and #397 are all the same issue.

Devices tested:

  • iOS Simulator (iPhone 11 pro max, iOS 13.0) - Crashed
  • iOS Simulator (iPad Pro 3rd gen, iOS 13.0) - Crashed
  • Physical iOS device (iPhone 6 plus, iOS 12.4.1) - Worked
  • Physical iOS device (iPad Pro 3rd gen, iPadOS 13.1.1) - Worked

Versions:
flutter_webview_plugin: 0.3.8
Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.14.6 18G95, locale en)
Xcode - develop for iOS and macOS (Xcode 11.0)
Android Studio (version 3.4)

Full error log:

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.
	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. 
	(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x600000269950 h=--& v=--& _UIToolbarContentView:0x7f8fc5f108d0.height == 0   (active)>",
    "<NSLayoutConstraint:0x600000208cd0 V:|-(0)-[_UIButtonBarStackView:0x7f8fc5f12cd0]   (active, names: '|':_UIToolbarContentView:0x7f8fc5f108d0 )>",
    "<NSLayoutConstraint:0x6000002093b0 _UIButtonBarStackView:0x7f8fc5f12cd0.bottom == _UIToolbarContentView:0x7f8fc5f108d0.bottom   (active)>",
    "<NSLayoutConstraint:0x6000002700a0 UIButtonLabel:0x7f8fc5f29a70'Done'.centerY == _UIModernBarButton:0x7f8fc5f279b0'Done'.centerY + 0.5   (active)>",
    "<NSLayoutConstraint:0x600000268870 'TB_Baseline_Baseline' _UIModernBarButton:0x7f8fc5f279b0'Done'.lastBaseline == UILayoutGuide:0x600001828b60'UIViewLayoutMarginsGuide'.bottom   (active)>",
    "<NSLayoutConstraint:0x6000002688c0 'TB_Top_Top' V:|-(>=0)-[_UIModernBarButton:0x7f8fc5f279b0'Done']   (active, names: '|':_UIButtonBarButton:0x7f8fc5f27350 )>",
    "<NSLayoutConstraint:0x600000268a00 'UIButtonBar.maximumAlignmentSize' _UIButtonBarButton:0x7f8fc5f27350.height == UILayoutGuide:0x60000183d260'UIViewLayoutMarginsGuide'.height   (active)>",
    "<NSLayoutConstraint:0x600000209310 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x60000183d260'UIViewLayoutMarginsGuide']-(0)-|   (active, names: '|':_UIButtonBarStackView:0x7f8fc5f12cd0 )>",
    "<NSLayoutConstraint:0x6000002687d0 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x600001828b60'UIViewLayoutMarginsGuide']-(16)-|   (active, names: '|':_UIButtonBarButton:0x7f8fc5f27350 )>",
    "<NSLayoutConstraint:0x60000020a170 'UIView-topMargin-guide-constraint' V:|-(0)-[UILayoutGuide:0x60000183d260'UIViewLayoutMarginsGuide']   (active, names: '|':_UIButtonBarStackView:0x7f8fc5f12cd0 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x6000002700a0 UIButtonLabel:0x7f8fc5f29a70'Done'.centerY == _UIModernBarButton:0x7f8fc5f279b0'Done'.centerY + 0.5   (active)>

Code:

  @override
  Widget build(BuildContext context) {
      return WebviewScaffold(
            url: "https://google.com",
            withZoom: false,
            withJavascript: false,
            withLocalStorage: false,
            displayZoomControls: true,
            resizeToAvoidBottomInset: true,
            appBar: AppBar(
              title: Text(
                "App bar",
                style: TextStyle(
                  color: Colors.white,
                  fontSize: 24,
                  fontFamily: 'Augustus',
                  fontWeight: FontWeight.w700,
                ),
              ),
              automaticallyImplyLeading: false,
              centerTitle: true,
              backgroundColor: Color(0xFF151846),
              elevation: 0,
            ),
          );
  }

@charafau
Copy link
Collaborator

charafau commented Oct 1, 2019

@hcaz thanks for report, I'm not sure how to tackle this bug tbh. Maybe it's simulator bug?

I was able to throw exception (it didnt crash just, was thrown) on iOS Simulator (iPhone 11 pro max, iOS 13.0) as you wrote but when I used Xr it was working as expected.

@hcaz
Copy link

hcaz commented Oct 2, 2019

@charafau I will clarafy what I mean by crash, the app doesnt close, it throws the exepction into debug and then the app is unresponsive to me, but it wont actually cause the app to close.

I will do some more testing later in different simulators to see if there is anything related beetween them, but it does look like it may be a simulator issue and not pysical (I have ran out of pysical devices to test on though, so if anybody else can test that may help pin point this)

@charafau
Copy link
Collaborator

charafau commented Oct 2, 2019

@hcaz great, thank you for help 🙇

@leorachit
Copy link

Any solution for this?

@oplengs001
Copy link

any help on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants