Closed CrowdedFuzzball closed 4 years ago
Hi, im having the same issue with modal pages.
The following error is thrown when clicking on a search box:
"Objective-C exception thrown. Name: NSGenericException Reason: Unable to activate constraint with anchors... because they have no common ancestor. Does the constraint or its anchors reference items in different view hierarchies? That's illegal."
Does either of you have a small sample app that reproduces the issue?
Does either of you have a small sample app that reproduces the issue?
Sure! This is a little example in zip.
If you need something more - i will try to help you and provide all necessary information.
@thecashit Thank you! I can reproduce
OK this is SO weird. This null check throws a constraint exception:
Looks like the debugger is misleading. This is the lines that causes a crash: https://github.com/dotMorten/XamarinFormsControls/blob/7584711b9341c213bb9629e304da01989155353a/AutoSuggestBox/Platform/NativeAutoSuggestBox.iOS.cs#L196-L199
The textbox and the dropdown isn't sharing parents in a model case. Not sure how to handle this just yet. Somehow need to detect that we need to use a different RootViewController
@@thecashit @FedericoJoseLucia Just pushed v1.1.0 with a fix. Thank you for the reproducer. It made it a lot easier. Do note though that I had to change the vertical options to not be the default expand, but Center or Top for the dropdown to show.
@dotMorten Works like a charm! Thank you!
You're welcome, and thank you for the sponsorship. Much appreciated! And the repro. Repros makes my life easy 😁
@dotMorten Hello! Unfortunately, same problem appears again. It is likely that this is due to updating Forms or iOS on the emulator.
The archive for repro is still the same. Forms 4.6.0.800 dotMorten.AutosuggestBox 1.1.1 iOS simulator 13.5
When trying to change an ItemSource, an exception about Constraints fires and app crashes.
Could you please inspect and fix that?
Thanks
@thecashit Have you tried debugging the issue with source from this repo?
@dotMorten
At this time only for package from NuGET
In monotouch debugger i can see following: Objective-C exception thrown. Name: NSGenericException Reason: Unable to activate constraint with anchors <NSLayoutYAxisAnchor:0x600001774e80 "UITableView:0x7fc01f355e00.top"> and <NSLayoutYAxisAnchor:0x600001775980 "UITextField:0x7fc01f2ef400.bottom"> because they have no common ancestor. Does the constraint or its anchors reference items in different view hierarchies? That's illegal. Native stack trace: 0 CoreFoundation 0x00007fff23e3cf0e __exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff50ba89b2 objc_exception_throw + 48 2 Foundation 0x00007fff25abd6d6 -[NSLayoutConstraint setActive:] + 0 3 AutoSuggestBoxTest.iOS 0x00000001021ee929 xamarin_dyn_objc_msgSend + 217 4 ??? 0x000000010cd65f4c 0x0 + 4510342988
If we go deeper i think the problem is in the Platform/NativeAutoSuggestBox.iOS.cs in 276 line
But i didn't know if this helps or not )
@dotMorten Excuse me for disturbing you. Are there any updates on this issue?
The fact is that this plugin is used on a working project and we would like to release an update with a fix, as it affected the user's work.
If this problem will be fixed shortly and you are doing it, we will wait for the update in nuget. If not, we will copy the code for ourselves and try to figure it out on our own and send you information.
In general, we need to understand what to do next as it's very important for us)
No I do this on my spare time for free, but family, paying job and my mental health always comes first, and I haven't had the time or energy lately to look at this. Any help, PRs etc are greatly appreciated, and is how open source should work.
@dotMorten Yes, I understand how OpenSource works :) And thank you again for this excellent project.
As described above - my request was not some kind of requirement, rather a request for information.
Nevertheless, we try to compile your project with the latest Xamarin.Forms and found that your plugin works fine, that is, in fact, all that is required to replace:
From: <PackageReference Include = "Xamarin.Forms" Version = "3.1.0.583944" / >
To:
I didn’t think that in this case PR is required, since in any case it is required to recompile the plugin. I advise you to update the version of XF in the repository and then this problem should be solved. Maybe a lot of others, who knows
There's no need to recompile. You can select a newer version of forms to use. 3.1 is merely a minimum
Hello!
Thanks for the excellent control. Until a certain time, there were no problems with its use, however, either after switching from PCL to .NET Standart, or after updating its version, there was a problem with iOS13.
Description
If a window with the specified component is opened through the following construction, an error occurs: await Navigation.PushModalAsync (Page);
I saw in issues that opening a window through Application.Current.MainPage = new PageWithAutoSuggestBox ... solves the problem and it really solves it.
However, the use of modal windows is fundamental in our project. Hope it it's not a hard job to fix this and this controll will be better.
Trace from release mode
================================================================= Basic Fault Address Reporting ================================================================= Memory around native instruction pointer (0x7fff51af733a):0x7fff51af732a ff ff c3 90 90 90 b8 48 01 00 02 49 89 ca 0f 05 .......H...I.... 0x7fff51af733a 73 08 48 89 c7 e9 e5 a2 ff ff c3 90 90 90 b8 53 s.H............S 0x7fff51af734a 00 00 02 49 89 ca 0f 05 73 08 48 89 c7 e9 cd a2 ...I....s.H..... 0x7fff51af735a ff ff c3 90 90 90 b8 83 01 00 02 49 89 ca 0f 05 ...........I.... ================================================================= Managed Stacktrace: ================================================================= ================================================================= 2020-03-27 12:42:23.274929+0500 Project.ios[8314:254428] Unhandled Exception: Foundation.MonoTouchException: Objective-C exception thrown. Name: NSGenericException Reason: Unable to activate constraint with anchorsBacktrace from ios release mode in enclosure
Steps to Reproduce
Basic Information