Hi,
I am getting errors when generating the release version of android.
The problem has come at the time of putting a searchbar to the project, for which I have followed the following tutorial:
https://codetraveler.io/2020/10/31/adding-a-search-bar-to-xamarin-forms-navigationpage/
In AppCenter I have caught 2 different errors, but it seems that it is the same:
error 1:
System.InvalidProgramException
System.InvalidProgramException: Invalid IL code in X.Core.ViewModels.MyViewModel: get_SearchedItems (): IL_0046: call 0x2b000212
error 2:
SearchPageRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1 [TElement] e)
System.InvalidProgramException: Invalid IL code in X.Droid.CustomRenders.SearchPageRenderer: AddSearchToToolbar (string): IL_0122: call 0x0a00421c
The property that the collection binds to is:
public ObservableCollection <MyViewModel> SearchedItems => string.IsNullOrEmpty (SearchText)? MyViewModelsList:
new ObservableCollection <MyViewModel> (MyViewModelsList.ToList (). Where (s =>! string.IsNullOrEmpty (s.Name) && s.Name.ToLower (). Contains (SearchText.ToLower ())));
Any ideas? On iOs it works correctly.
Thanks