Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

ViewCell - Specified CAST is not valid (iOS) #1424

Closed
MsXam opened this issue Dec 19, 2017 · 24 comments · Fixed by #1513
Closed

ViewCell - Specified CAST is not valid (iOS) #1424

MsXam opened this issue Dec 19, 2017 · 24 comments · Fixed by #1513

Comments

@MsXam
Copy link

MsXam commented Dec 19, 2017

Description

Xamarin forms APP deployed on iOS Device/Simulator causes System.InvalidCastException: Specified cast is not valid.

Steps to Reproduce

  1. Take the attached XAML file (Strip out references to prism if not using Prism) and Create a NavigationPage that navigates to this view.
  2. Run the APP on (We used a Live Device iPhone X running iOS 11.2)
  3. When the App appears - place your finger on the TableView and rapidly scroll up and down so that the contents of the TableView scrolls in BOTH directions.

Expected Behavior

Expect the contents of the TableView to simply scroll up and down.

Actual Behavior

After a few scrolls up and down - the APP CRASHES

Basic Information

  • Version with issue:
    XF 2.5.0.121934, XF 2.5.0.91635 havent tested other versions
  • Last known good version:
    We dont get the issue with XF 2.3.4.270
  • IDE:
    VS 2017 Enterprise (Windows 10)
  • Platform Target Frameworks:
    • iOS: Fails on iOS.
    • Android: No Issues On Android
    • UWP: Havent tested on UWP
  • Android Support Library Version: N/A
  • Nuget Packages:
  • Affected Devices:
    We get this issue on Simulators and also live Devices - i.e iPhone X & iPhone 7 Plus so far tested and fails

Other Info :
Microsoft Visual Studio Enterprise 2017
Version 15.5.2
VisualStudio.15.Release/15.5.2+27130.2010
Microsoft .NET Framework
Version 4.7.02556
Xamarin 4.8.0.753
Xamarin Designer 4.8.188
Xamarin.Android SDK 8.1.0.25
Xamarin.iOS and Xamarin.Mac SDK 11.6.1.2

Screenshots

image

image
ViewCell.txt

Reproduction Link

@rmarinho
Copy link
Member

Seems a problem with render reuse on the TableViewRenderer, is trying to reuse a old cell renderer that is not the correct type.

@rmarinho rmarinho moved this from New to Ready For Work in Triage Dec 21, 2017
@jassmith
Copy link

A temporary fix would be to use a ListView instead with a DataTemplateSelector

@MsXam
Copy link
Author

MsXam commented Dec 22, 2017

ListView with a DTS is not suitable within the realms of the business functionality of the app - one of which is the requirement for cells to auto scroll accordingly when the onscreen hardware keyboard is shown. TableView provides this for free in iOS without the need for additional sugar coating. Guys - can you please advise if there is an Alpha build that fixes this ?

@opcodewriter
Copy link

I'm sorry but instead of weird features like CSS styles, doesn't make more sense to focus on really fixing and nailing issues related to basic controls and features like this one?

@mnidhk
Copy link

mnidhk commented Jan 4, 2018

Same issue in issue #1414 i filed some days earlier then you, with test project in it.
Still no fix available? This is indeed the base of all list views so i can't update to latest firmware's due this bug.

@MsXam
Copy link
Author

MsXam commented Jan 4, 2018

Yes. #1414 is exactly the same as the issue raised here. I have had to downgrade to XF 2.4.0.280 in order to allow our app to at least run without crashing when scrolling within a TableView. Sadly it would appear that this bug is not really a priority to be fixed.

@aelien
Copy link

aelien commented Jan 4, 2018

I also had to downgrade but to XF 2.3.4.270
image it still crashes but not that often than with 2.5 I hope this becomes a priority for them.

@michaeldwan
Copy link
Contributor

This regression was introduced in #1136, so 2.4.0.91020 is safe to use for now. I have it fixed against 2.5 locally and will try and get a PR out today.

@Sagariouz
Copy link

Any new developments/possible fixes on this issue? Downgrading is not the most ideal solution for us.

Triage automation moved this from Ready For Work to Invalid Jan 18, 2018
@duzenko
Copy link

duzenko commented Feb 13, 2018

Excuse me, what is the release version that has this fixed?

@INHack20
Copy link

+1

@MsXam
Copy link
Author

MsXam commented Feb 23, 2018

So two months on from when I originally raised this critical issue - its still not fixed.

FYI - This is fixed in 2.3.4.270 and 2.4.0.280. - any releases of XF after these versions , things just went downhill on all platforms ... from gesture recognizers not working still on Android when wrapped inside a few containers to events not firing if a background color is set ?!!

There are just too many bugs in XF after 2.4.0.280 especially in 2.5x. I have literally wasted days leading into weeks regression testing every new XF release its just too painful and pathetically tested its beyond a joke, you cant cry so just need to laugh and hope things will improve although I strongly doubt it as there are just not enough intelligent resources or seasoned engineers thrown at resolving bugs and improving stability in XF but it would appear management/product owner believe incorporating things such as fast renderers (which just dont work) and css styling are more important .... Sadly, xamarin/mircosoft no longer listen or provide any consistent feedback to critical issues like this so that we are kept in the loop and know the timescales when things will be fixed or more importantly whether they will just be placed in the famous 'backlog' -(read 'will be ignored')

@davidortinau
Copy link
Contributor

I'm reviewing this today and will work to get you this fix. We have definitely missed something here, and I deeply apologize. As anyone has issues like this that appear critical that you feel are not getting the attention and movement you require, please please please let me know. Email is probably the best: david.ortinau@microsoft.com.

I'm looking into why this issue isn't labeled as a regression though it seems many here clearly have verified that it is. And why it isn't marked on our release notes generator as a fixed bug even though we have a PR referencing it.

We have recently discussed how to handle priority labels, and will be re-implementing that.

Has anyone confirmed that the Nightly build resolves this issue for your applications?

believe incorporating things such as fast renderers (which just dont work) and css styling are more important

Perhaps we could have a call @MsXam so I can better understand your perspective here. If you would be interested, please shoot me an email.

@opcodewriter
Copy link

Sorry. I love Xamarin. I just hope things will get much better, and sooner.

@davidortinau
Copy link
Contributor

I've tested this using the project on #1414 with 2.6.0.211236-nightly, and I'm no longer able to reproduce the crash. If this isn't the case for others here, please let me know.

I'm raising this issue with engineering to get the fix into a release.

@stephenhauck
Copy link

Really need this resolved .. any idea when it will be pushed ?

@crutchcodes
Copy link

@davidortinau are you thinking that this will be pushed out as a hot fix or will we have have to wait for the next srX release?

@davidortinau
Copy link
Contributor

It's out. Would you please update to 2.5.1-pre1 and test it? https://developer.xamarin.com/releases/xamarin-forms/xamarin-forms-2.5/2.5.1-pre1/

@stephenhauck
Copy link

I am testing it and have another group testing it as well.
I seems to work on my simulator and iPhone 7Plus right off in a debug build but I do need to do more extensive testing this evening and over the weekend, thanks for the heads up!

@crutchcodes
Copy link

Seems to be working again for me (so far)... but as the poster above, we will need to do a lot more testing. Especially since I'm coming from XF 2.3.x...

@crutchcodes
Copy link

My testing results are that this issue is resolved, but unfortunately this pre-release build broke something that is a new blocker for me.#2019

@pauldiston
Copy link

I also experience this issue with a ListView with custom ViewCells. Early indications seem that version 2.5.1.317207-pre1 addresses the crash I am having.

@Szymaniuk
Copy link

FYI - #2042 is also affected, as well as #2019 .

@grantwardle
Copy link

I am having this issue when I scroll down in my ListView of custom cells. I am using a list view with datatemplates. All cells are the same except some look different due to bindings. I am using xamarin.forms 2.4, recently updated to xamarin.forms 2.5 and issue still occurs.

At first I thought it was an issue with the rendering of stacklayouts, so I recreated the view in relative layouts and also in absolute layouts - this issue still persists.

I am in dire need of a fix for this issue, can anybody help?

@samhouts samhouts removed this from Closed in Triage Jun 12, 2018
mattleibow pushed a commit that referenced this issue Jan 28, 2021
Fixed wrong device name issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.