-
Notifications
You must be signed in to change notification settings - Fork 1.9k
No constructor found for Xamarin.Forms.Platform.Android.LabelRenderer #2584
Comments
@aixiaozi Which version of Xamarin.Forms does your application use? |
@hartez , Xamarin Forms version: 2.5.0.122203 |
@aixiaozi Is the application using ListViews? |
@hartez yeah, can you give us a direction about how to resolve this crash issue? |
@aixiaozi Without being able to see your code or a reproduction of the issue, there is not much guidance I can give you. I can tell you that we've fixed several ListView bugs since 2.5.0, so updating your application to a more recent version of Forms may help. |
@radical , hi, our customer said that they could resolve this issue by adding a constructor in LabelRenderer and avoiding animation while navigating. For now, our customer wants to know the root cause of the issue, can you help our customer on that? I could send you customer's sample project but we need to protect customer's privacy, please tell me how can I share this project with you. |
@aixiaozi The cases I've seen this come up is when a handler hasn't been detached from a disposed renderer so then mono tries to manually "re-activate" the renderer by instantiating a new one but it can't because it doesn't have a default constructor that mono can use. It definitely "works" to supply that constructor but that most likely still causes down stream issues as there is now dangling instances. If you follow the original stack trace you can see what I'm talking about. Here's a good write up from @jonpryor that gets more into the technical side of it The scenario he is talking about is more about construction why the exception is happening is about the same @aixiaozi if you have a project where you can consistently recreate this that would be awesome!! shneuvil at microsoft |
@PureWeen , thanks for your reply. The problem is that if the customer just add the
Our customer resolved this issue by did some minor tweaking in his LabelRenderer and avoiding animation while navigating. Here is the customer's final solution: 1. Did some minor tweaking in LabelRenderer
2. Stopped animation on page navigation using the below code
And I will send you an email to share customer's project. But as our customer said, reproducing it is tough. They spend 2-3 hours and do lot of testing then they get this issue. QuestionFor now, customer need a confirmation that these are indeed the correct way to handle the issues. Do you have any tips or suggestion about this? Thanks and do look forward to your reply. |
@PureWeen , is there any updates? :) |
@aixiaozi We also have the same issue. Is your work around works well?!!! |
@fishajavier is your scenario also based around animations? Do you have a small repro by chance of your issue that we can look at? I have a PR here |
We understand that this is an intermittent issue. If you can, please try Xamarin.Forms 3.1.0.561732-pre4 and let us know if it appears to resolve your issue. If not, please provide a sample project that exhibits the problem, if at all possible. Thank you! |
If this helps, I hit the same problem today in the Google Pre-launch test for an app. Xamarin.Forms 3.0.0.561731
|
This is still an issue for us. This crash is happening on around 300 users in our Production App. Users are frustrated and uninstall our app in unexpected rate. Any workaround please? @PureWeen We can't reproduce the issue for you to investigate; it only happens on production. |
@schemburkar @fishajavier Some fixes were put into the upcoming 3.1 release that should resolve this issue. Once you're able to run with the next 3.1 let me know if you are still seeing the issue. |
@PureWeen I tried with 3.1.0.561732-pre4 and the issue is still present. I can see that 3.1.0.583944 got released few hours ago, I will test using those bits today. |
Issue is still present. @PureWeen tested with the latest bits 3.1.0.583944 |
@schemburkar do you have a reproduction at all you can share? The problem with this type of exception is that it can manifest in a lot of different ways. For example if I create a custom renderer and add a touch handler that I never remove it can cause this exception What's interesting about your stacktrace is that it's thrown during the dispose call from the page and I don't feel like I've seen it thrown from that point in the code before. It seems odd that a |
@PureWeen My app code is on VSTS so might not be possible to share as is, I will try to create a standalone GitHub repo. https://drive.google.com/file/d/1JxdGK-NKfX1YQAiNEVAvUe4Th9lNlLHe/view?usp=sharing |
Random crashes on android 6 and 8.1. SDK version 27 (8.1) Xamarin forms 2.5 and 3.0 Xamarin forms 2.5: Xamarin caused by: android.runtime.JavaProxyThrowable: System.NotSupportedException: Unable to activate instance of type ExtendedEntryRenderer from native handle 0x7fefba88b4 (key_handle 0xe3a7635). ---> System.MissingMethodException: No constructor found for ExtendedEntryRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown. Xamarin Forms 3.0: Xamarin caused by: android.runtime.JavaProxyThrowable: System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer from native handle 0x7fcbd10ba4 (key_handle 0x95fa57b). ---> System.MissingMethodException: No constructor found for Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown. |
@schemburkar if you want to zip up and email it to me that's also an option shneuvil at microsoft
So I'm just curious to see how things are put together @KaelSuncaster if you have a small repro that'd be useful or some more information about the page you are seeing this on General Note |
@PureWeen An update: Not sure why, After deleting all binaries (nuget, bin, obj, etc) and re-creating apk has passed the pre-launch tests from Google. I will keep monitoring if issue comes up in the wild again. In any case, I have created a code zip to share with you on email in few days. |
Closing this for now. If anyone is still getting this exception with the latest Xam Forms please provide a repro or a stack trace with as much information as possible about the XAML and how you are causing it to happen. Though a repro would be preferred |
Description
Our customer are developing a Xamarin Forms application which is running on an android scanner device. Inconsistently, customer get the issue of "no constructor found.." for random controls.
Steps to Reproduce
Unknown, but if customer spend 2-3 hours and do lot of testing then they could get this issue.
Expected Behavior
Not crashing
Actual Behavior
Crashing
Origianl Crash Log
The log for one such crash is below:
Something customer have tried to resolve this issue but it raised another issue
Customer read a lot of artical or documentaion about this:
So customer tried using the work around solution of custom rendering the label class and adding the constructor as mentioned in the stack overflow url that i shared.
After about 2 hours of testing, customer don't see the label renderer issue. But they got the a new crash issue:
Basic Information
Version with issue:
Last known good version:
IDE: Visual Studio 2017 15.6.6
Platform Target Frameworks:
Android Support Library Version: 25.4.0.2
Nuget Packages: Arc.UserDialogs 7.0.1 Xamarin.Forms 2.5.0.122203 Symbol.XamarinEMDK 2.7.0.76-rc
third part SDK: EMDK, and VS has to configured with EMDK
Affected Devices: Scanner device: TC8000 of Zebra
Screenshots
Reproduction Link
The text was updated successfully, but these errors were encountered: