Xamarin.forms: System.ObjectDisposedException: impossible d'accéder à un objet supprimé 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'

Créé le 20 mai 2020  ·  73Commentaires  ·  Source: xamarin/Xamarin.Forms

_Ce problème a été déplacé d' un ticket sur la communauté des développeurs ._


Après la mise à niveau vers Xamarin Forms 4.6.0726, vous commencez à subir de fréquents plantages intermittents sur Android. Après enquête, trouvé que cela provient de LabelRenderer de Xamarin

05-17 07: 27: 06.656 E / mono (5133):
05-17 07: 27: 06.656 E / mono (5133): Exception non gérée:
05-17 07: 27: 06.656 E / mono (5133): System.ObjectDisposedException: Impossible d'accéder à un objet supprimé.
05-17 07: 27: 06.656 E / mono (5133): Nom de l'objet: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.
05-17 07: 27: 06.656 E / mono (5133): at (méthode dynamique du wrapper) Android.Runtime.DynamicMethodNameCounter.29 (intptr, intptr)
05-17 07: 27: 06.656 E / mono (5133): at (wrapper natif à géré) Android.Runtime.DynamicMethodNameCounter.29 (intptr, intptr)
05-17 07: 27: 06.656 E / mono-rt (5133): [ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: Impossible d'accéder à un objet supprimé.
05-17 07: 27: 06.656 E / mono-rt (5133): Nom de l'objet: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.
05-17 07: 27: 06.656 E / mono-rt (5133): at (méthode dynamique du wrapper) Android.Runtime.DynamicMethodNameCounter.29 (intptr, intptr)
05-17 07: 27: 06.656 E / mono-rt (5133): at (wrapper natif à géré) Android.Runtime.DynamicMethodNameCounter.29 (intptr, intptr)
05-17 07: 27: 06.698 D / (5133): HostConnection :: get () Nouvelle connexion hôte établie 0xbd1b1240, tid 5133

Je ne sais pas d'où ça vient. J'ai ListView comme vue principale et je me demande que quelque chose ne va pas avec la nouvelle version de ListView provoquant une fuite et un crash.

Je n'ai pas de rendu d'étiquette personnalisé, il doit donc provenir du moteur de rendu de la plate-forme de Xamarin
Veuillez suggérer.


Commentaires originaux

Système de rétroaction Visual Studio le 17/05/2020, 23:54:

Nous avons transmis vos commentaires à l'équipe d'ingénierie appropriée pour une évaluation plus approfondie. L'équipe examinera les commentaires et vous informera des prochaines étapes.


Solutions originales

(pas de solutions)

4.4.0 collectionview fastrenderers label listview 5 feedback-ticket high regression in-progress high impact Android unverified bug

Commentaire le plus utile

Il est tout à fait ridicule que la façon dont Microsoft puisse s'attendre à utiliser cette plate-forme pour créer une application d'entreprise avec un tel défaut de base se soit encore ouverte après tant de plaintes sur une si longue période!

Nous n'avons pas été en mesure de publier la mise à jour de notre version Android de l'application au cours des 4 derniers mois et tout ce que nous obtenons de ce fil est qu'ils ne peuvent pas reproduire cela, alors que le reste du monde le peut facilement !!!

Microsoft devrait arrêter de faire quoi que ce soit et tout avant que ce bogue puisse être corrigé. Publier une version plus récente de Xamarin est pratiquement inutile !!!

Tous les 73 commentaires

Connexes # 8262

Solution de contournement - https://github.com/xamarin/Xamarin.Forms/issues/8262#issuecomment -550022425

La création d'un moteur de rendu personnalisé pour un ListView ou ses cellules est une approche pour réduire l'effet des calculs de disposition sur les performances de défilement.
Meilleures pratiques ListView - https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/listview/performance

Essayez d'implémenter INotifyPropertyChanged (System.ComponentModel) pour la classe qui contient le ListView.
Définissez le gestionnaire pour public event PropertyChangedEventHandler PropertyChanged comme suit pour l'accesseur set de la propriété modifiée-

var args = new PropertyChangedEventArgs(nameOf(typeOf(string)));
PropertyChanged?.Invoke(this, args);

Associé # 10159

Pouvez-vous s'il vous plaît joindre un petit projet qui illustre ce problème? Merci!

Je suis également confronté au même problème en plantant mon application

Trace de la pile:

Cannot access a disposed object. Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.
Java.Interop.JniPeerMembers.AssertSelf(Java.Interop.IJavaPeerable self) in <26521a5118b44c858c385715922b9d5d>
Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod(System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) in <26521a5118b44c858c385715922b9d5d>
Android.Views.View.get_Context() in <4ccdb3137d974856b786e1aeebbfbab6>
Xamarin.Forms.Platform.Android.Platform.GetNativeSize(Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:1341
Xamarin.Forms.Forms+AndroidPlatformServices.GetNativeSize(Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) in D:\a\1\s\Xamarin.Forms.Platform.Android\Forms.cs:930
Xamarin.Forms.VisualElement.OnSizeRequest(System.Double widthConstraint, System.Double heightConstraint) in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:800
Xamarin.Forms.VisualElement.OnMeasure(System.Double widthConstraint, System.Double heightConstraint) in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:783
Xamarin.Forms.VisualElement.GetSizeRequest(System.Double widthConstraint, System.Double heightConstraint) in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:659
Xamarin.Forms.VisualElement.Measure(System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:717
Xamarin.Forms.StackLayout.CalculateNaiveLayout(Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:163
Xamarin.Forms.StackLayout.CalculateLayout(Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:123
Xamarin.Forms.StackLayout.OnSizeRequest(System.Double widthConstraint, System.Double heightConstraint) in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:80
Xamarin.Forms.VisualElement.OnMeasure(System.Double widthConstraint, System.Double heightConstraint) in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:783
Xamarin.Forms.VisualElement.GetSizeRequest(System.Double widthConstraint, System.Double heightConstraint) in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:659
Xamarin.Forms.Layout.GetSizeRequest(System.Double widthConstraint, System.Double heightConstraint) in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:132
Xamarin.Forms.VisualElement.Measure(System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:717
Xamarin.Forms.StackLayout.CalculateNaiveLayout(Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:198
Xamarin.Forms.StackLayout.CalculateLayout(Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:123
Xamarin.Forms.StackLayout.LayoutChildren(System.Double x, System.Double y, System.Double width, System.Double height) in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:58
Xamarin.Forms.Layout.UpdateChildrenLayout() in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:266
Xamarin.Forms.Layout.OnSizeAllocated(System.Double width, System.Double height) in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:224
Xamarin.Forms.VisualElement.SizeAllocated(System.Double width, System.Double height) in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:805
Xamarin.Forms.Layout.ResolveLayoutChanges() in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:392
Java.Lang.Thread+RunnableImplementor.Run() in <4ccdb3137d974856b786e1aeebbfbab6>
Java.Lang.IRunnableInvoker.n_Run(System.IntPtr jnienv, System.IntPtr native__this) in <4ccdb3137d974856b786e1aeebbfbab6>
(wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.48(intptr,intptr)

La rétrogradation de XF vers la version 4.4.0.991864 a résolu le problème sur notre application de production. Crédits: https://github.com/xamarin/Xamarin.Forms/issues/10159#issuecomment -633838442

Pouvez-vous s'il vous plaît joindre un petit projet qui illustre ce problème? Merci!

@samhouts Je ne peux pas publier le code source, c'est une application commerciale ... et cela ne peut fonctionner qu'avec des données.

Pouvez-vous s'il vous plaît joindre un petit projet qui illustre ce problème? Merci!

@samhouts malheureusement je ne peux pas publier le code pour des raisons contractuelles

Bonjour, je vérifie simplement s'il y a des délais à partir desquels le correctif serait disponible. Nous avons une version majeure en cours de sortie et est maintenant en attente uniquement à cause de ce problème après la mise à niveau de notre infrastructure Xamarin. À ce stade, nous ne pouvons pas non plus revenir à l'ancien cadre.

Veuillez aider.

Ces problèmes sont très difficiles à résoudre sans reproduction. Vous pourrez peut-être contourner ce problème en

Ces problèmes sont très difficiles à résoudre sans reproduction. Vous pourrez peut-être contourner ce problème en

Je comprends, j'essaye de reproduire sur un projet de test.

Ces problèmes sont très difficiles à résoudre sans reproduction. Vous pourrez peut-être contourner ce problème en activant les moteurs de rendu hérités. Si vous êtes en mesure de publier un projet de reproduction, nous pourrons peut-être résoudre complètement le problème. Je vous remercie!

@samhouts , j'ai essayé d'activer les moteurs de rendu hérités selon les instructions fournies, mais étonnamment, l'erreur persiste!

J'ai essayé de nettoyer la solution, de fermer / ouvrir VS mais l'erreur persiste.

Veuillez suggérer. Toute aide à cet égard serait extrêmement utile!

Bonjour,

Vous essayez de suivre pour voir s'il y a encore des mises à jour ou quand s'attendre à des mises à jour à ce sujet?

nous sommes également confrontés au problème, il est vraiment difficile à reproduire, l'application plante au hasard,
Le problème a commencé à se produire après la mise à niveau de Xamarin form 4.4 vers 4.6.0726.

Je dois déplacer ceci vers la ressource bloquée jusqu'à ce que nous puissions obtenir une reproduction.

@samhouts Cela ressemble beaucoup à # 10159 qui est un problème assez sérieux. Pouvez-vous s'il vous plaît y jeter un œil? Il y a un commentaire offrant un échantillon de repro.

J'ai créé un exemple de référentiel où vous pouvez voir cette exception: https://github.com/nacompllo/CannotDisposeLabelRenderer

J'ai également posté une vidéo montrant comment reproduire l'erreur:
https://www.youtube.com/watch?v=yDhlI4BG8D8&feature=youtu.be

La description

Lorsque j'ajoute une liaison à la propriété FontSize d'un Label à l'intérieur d'un CollectionView et que j'effectue des rotations avec l'appareil (à chaque changement de rotation, je mets à jour le FontSize des Labels de CollectionView).

System.ObjectDisposedException: 'Impossible d'accéder à un objet supprimé.
Nom de l'objet: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'. '

Étapes à suivre pour reproduire

Ajoutez des éléments à la source de CollectionView tout en effectuant des rotations avec l'appareil.

Informations de base

  • Je ne l'ai essayé que sur Android car je n'ai pas d'appareils Apple.
  • Xamarin.Forms 4.7.0.1239
  • Android 10

@samhouts Après avoir fait quelques tests sur ma machine avec le référentiel Xamarin.Forms, j'ai suivi la trace de l'erreur et cela se produit exactement dans cette ligne de la classe Platform.cs: https://github.com/xamarin/Xamarin.Forms /blob/29b92aa1fc2b9d834bb3b95cc224e07d0cc3e9b4/Xamarin.Forms.Platform.Android/Platform.cs#L1341

J'ai enveloppé la méthode dans un try catch pour obtenir le StackTrace et voici le résultat:
à Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] dans: 0
à Java.Interop.JniPeerMembers + JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, paramètres Java.Interop.JniArgumentValue *) [0x00000] dans: 0
sur Android.Views.View.get_Context () [0x00000] dans /Users/builder/azdo/_work/204/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-29/mcw/Android .Views.View.cs: 5598
à Xamarin.Forms.Platform.Android.Platform.GetNativeSize (vue Xamarin.Forms.VisualElement, System.Double widthConstraint, System.Double heightConstraint) [0x0001c] dans C: Users \ SourceReposXamarin.FormsXamarin.Forms.Platform.Android: 1343

Tout le monde a la solution pour cela ??

Je suis confronté à la même erreur dans mon projet. J'ai la version Xamarin.Forms 4.6.0.726.
Trace de la pile:

  at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <dac4c5a4b77f4e61a5e6d9d3050dfb9f>:0 
  at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <dac4c5a4b77f4e61a5e6d9d3050dfb9f>:0 
  at Android.Views.View.get_Context () [0x00000] in /Users/builder/azdo/_work/204/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-29/mcw/Android.Views.View.cs:5598 
  at Xamarin.Forms.Platform.Android.Platform.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x00019] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:1341 
  at Xamarin.Forms.Forms+AndroidPlatformServices.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\Forms.cs:930 
  at Xamarin.Forms.VisualElement.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00025] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:800 
  at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:783 
  at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:659 
  at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:717 
  at Xamarin.Forms.Grid.CalculateAutoCells (System.Double width, System.Double height) [0x000e5] in D:\a\1\s\Xamarin.Forms.Core\GridCalc.cs:133 
  at Xamarin.Forms.Grid.MeasureGrid (System.Double width, System.Double height, System.Boolean requestSize) [0x0000c] in D:\a\1\s\Xamarin.Forms.Core\GridCalc.cs:485 
  at Xamarin.Forms.Grid.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x0002a] in D:\a\1\s\Xamarin.Forms.Core\GridCalc.cs:60 
  at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:783 
  at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:659 
  at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:132 
  at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:717 
  at Xamarin.Forms.TemplatedView.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x0003c] in D:\a\1\s\Xamarin.Forms.Core\TemplatedView.cs:43 
  at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:783 
  at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:659 
  at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:132 
  at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:717 
  at Xamarin.Forms.StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) [0x000a8] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:163 
  at Xamarin.Forms.StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) [0x00058] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:123 
  at Xamarin.Forms.StackLayout.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00019] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:80 
  at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:783 
  at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:659 
  at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:132 
  at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:717 
  at Xamarin.Forms.StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) [0x000a8] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:163 
  at Xamarin.Forms.StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) [0x00058] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:123 
  at Xamarin.Forms.StackLayout.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00019] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:80 
  at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:783 
  at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:659 
  at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:132 
  at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:717 
  at Xamarin.Forms.StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) [0x000a8] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:163 
  at Xamarin.Forms.StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) [0x00058] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:123 
  at Xamarin.Forms.StackLayout.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x0004e] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:58 
  at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x00158] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:266 
  at Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:224 
  at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:805 
  at Xamarin.Forms.Layout.ResolveLayoutChanges () [0x0005c] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:392 
  at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in /Users/builder/azdo/_work/204/s/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:36 
  at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in /Users/builder/azdo/_work/204/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-29/mcw/Java.Lang.IRunnable.cs:81 
  at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.1(intptr,intptr)

La fenêtre de sortie de l'application affiche ces sorties:

[mono] Exception non gérée:
[mono] System.ObjectDisposedException: Impossible d'accéder à un objet supprimé.
[mono] Nom de l'objet: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.
[mono] at (méthode-dynamique du wrapper) Android.Runtime.DynamicMethodNameCounter.1 (intptr, intptr)
[mono] at (wrapper natif à géré) Android.Runtime.DynamicMethodNameCounter.1 (intptr, intptr)
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: impossible d'accéder à un objet supprimé.
[mono-rt] Nom de l'objet: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.
[mono-rt] at (méthode-dynamique du wrapper) Android.Runtime.DynamicMethodNameCounter.1 (intptr, intptr)

Je peux reproduire cela dans notre repo, j'ai essayé quelque chose comme:

if (visualElementRenderer is IDisposedState disposableRenderer && disposableRenderer.IsDisposed)
    return new SizeRequest();

Mais cela ne fonctionne pas avec le même problème.

J'obtiens quelque chose de similaire dans 4.7.0.1179 lorsque je reviens d'une page contenant une CollectionView à une autre contenant une CollectionView:

LayoutPresenter.OnMeasure (System.Double widthConstraint, System.Double heightConstraint)

System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.

JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) View.get_Context () Platform.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) Forms+AndroidPlatformServices.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) VisualElement.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) LayoutPresenter.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) TemplatedView.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) Grid.MeasuredStarredColumns (System.Double widthConstraint, System.Double heightConstraint) Grid.MeasureAndContractStarredColumns (System.Double width, System.Double height, System.Double totalStarsWidth) Grid.MeasureGrid (System.Double width, System.Double height, System.Boolean requestSize) Grid.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) StackLayout.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) Layout.UpdateChildrenLayout () Layout.OnSizeAllocated (System.Double width, System.Double height) VisualElement.SizeAllocated (System.Double width, System.Double height) Layout.ResolveLayoutChanges () Thread+RunnableImplementor.Run () IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.59(intptr,intptr)

Juste quelques découvertes autour de ce @samhouts :
Nous voyions également ce comportement avec CollectionView. Après avoir passé du temps dessus, il semble que cela pourrait être dû aux événements suivants.

Remarque: ceci est une théorie.

  1. OnViewRecycled est appelé sur ItemsViewAdapter avec un TemplatedItemViewHolder.
  2. TemplatedItemViewHolder.Recycle est appelé, le Xamarin.Forms.View associé à TemplatedItemViewHolder est supprimé de ItemsView.
  3. Le TemplatedItemViewHolder est poussé vers RecyclerView.RecycledViewPool.
  4. Quelque chose se débarrasse de la vue / de ses enfants en attendant.
  5. Le ViewHolder est relié et affiché, des déclencheurs de disposition se produisent sur la vue supprimée et l'application se bloque.

J'ai contourné ce problème en remplaçant ItemsViewAdapter.OnViewRecycled et en retournant pour un TemplatedItemViewHolder. Ensuite, j'ai ajouté du code pour supprimer le TemplatedItemViewHolder.View de ItemsView dans OnBindViewHolder, avant d'appeler base.

Jusqu'à présent, aucun de ceux qui ont essayé n'a pu reproduire le problème plus longtemps

@joshuangfraedom pouvez-vous partager votre exemple de code pour le changement d'adaptateur et je verrai si cela résout le problème pour moi s'il vous plaît?

Quelque chose comme ça @DuncWatts

... 
namespace and renderer export
...
class MyCollectionViewRenderer : CollectionViewRenderer
{
        protected override GroupableItemsViewAdapter<GroupableItemsView, IGroupableItemsViewSource> CreateAdapter()
        {
            return new MyCollectionViewAdapter(ItemsView);
        }

        private class MyCollectionViewAdapter : ExtendedCollectionViewAdapter
        {
            ... base constructor call

            /// <inheritdoc />
            public override void OnViewRecycled(JObject holder)
            {
                if (holder is TemplatedItemViewHolder)
                {
                    return;
                }

                base.OnViewRecycled(holder);
            }

            /// <inheritdoc />
            public override void OnBindViewHolder(ViewHolder holder, int position)
            {
                if (holder is TemplatedItemViewHolder templatedItemViewHolder)
                {
                    ItemsView.RemoveLogicalChild(templatedItemViewHolder.View);
                }

                base.OnBindViewHolder(holder, position);
            }
        }
}

En lisant SelectableItemsViewAdapter il semble que ce qui précède introduira une fuite de mémoire. Nous avons vraiment besoin de cela résolu au niveau des formulaires pour une solution appropriée (tout est internalisé dans cette classe).

C'est un peu plus robuste et je pense que gère tous les éléments sélectionnables selon @DuncWatts @samhouts. Je ne sais toujours pas ce qui se débarrasse exactement des moteurs de rendu de la cellule.

Mais conserver la référence dans le ItemsView semble l'empêcher d'être suffisamment nettoyé.

    public class MyCollectionViewRenderer : ExtendedCollectionViewRenderer
    {
        private static readonly FieldInfo CurrentViewHoldersField;
        private static readonly Action<SelectableItemsViewAdapter<GroupableItemsView, IGroupableItemsViewSource>, object, int> ViewHolderClicked;
        private static readonly Func<SelectableItemsViewAdapter<GroupableItemsView, IGroupableItemsViewSource>, int, bool> PositionIsSelected;

        static MyCollectionViewRenderer()
        {
            CurrentViewHoldersField = // SelectableItemsViewAdapter._currentViewHolders via reflection
            ViewHolderClicked = // Gets SelectableItemsViewAdapter.SelectableClicked via reflection as a delegate
            PositionIsSelected =  // Gets SelectableItemsViewAdapter.PositionIsSelected via reflection as a delegate
        }

        public MyCollectionViewRenderer(Context context) : base(context)
        {
        }

        protected override GroupableItemsViewAdapter<GroupableItemsView, IGroupableItemsViewSource> CreateAdapter()
        {
            return new MyCollectionViewAdapter(
                groupableItemsView: ItemsView,
                tapColour: GetTapColour(),
                allowItemSelection: Element.SelectionMode != SelectionMode.None,
                viewAppearing: Element.ViewAppearing);
        }

        private class MyCollectionViewAdapter : GroupableItemsViewAdapter<GroupableItemsView, IGroupableItemsViewSource>
        {
            protected internal MyCollectionViewAdapter(GroupableItemsView groupableItemsView, Func<View, Context, ItemContentView> createView = null)
                : base(groupableItemsView,  createView)
            {
            }

            public override void OnViewRecycled(Java.Lang.Object holder)
            {
                // Prevent cleanup of the TemplatedItemViewHolder.
                // This cleanup looks to be the cause of the problem,
                // as it drops references to it's Xamarin Forms view.
                if (holder is TemplatedItemViewHolder templatedItemViewHolder)
                {
                    // Allows selection to be cleared in SelectableItemsViewAdapter.
                    var currentViewHolders = (List<SelectableViewHolder>)CurrentViewHoldersField.GetValue(this);
                    currentViewHolders.Remove(templatedItemViewHolder);
                    return;
                }

                base.OnViewRecycled(holder);
            }

            public override void OnBindViewHolder(ViewHolder holder, int position)
            {
                // If TemplatedItemViewHolder, do the stuff we want to do, plus the stuff forms was doing.
                // Except for SelectableItemAdapter. We don't want their events.
                // Thank you Xamarin team for using "Bind" on TemplatedItemViewHolder.
                if (holder is TemplatedItemViewHolder templatedItemViewHolder)
                {
                    // Remove the child from ItemsView, as TemplatedItemViewHolder.Bind(ItemsView) will
                    // Re-add it later on.
                    ItemsView.RemoveLogicalChild(templatedItemViewHolder.View);

                    if (ItemsSource.IsHeader(position))
                    {
                        templatedItemViewHolder.Bind(ItemsView.Header, ItemsView);
                    }
                    else if (ItemsSource.IsFooter(position))
                    {
                        templatedItemViewHolder.Bind(ItemsView.Footer, ItemsView);
                    }
                    else
                    {
                        // Also accounts for group header/group footer
                        templatedItemViewHolder.Bind(ItemsSource.GetItem(position), ItemsView);
                    }

                    // Allows selection to be cleared in SelectableItemsViewAdapter.
                    var currentViewHolders = (List<SelectableViewHolder>)CurrentViewHoldersField.GetValue(this);
                    currentViewHolders.Add(templatedItemViewHolder);

                    // Make sure that if this item is one of the selected items, it's marked as selected
                    templatedItemViewHolder.IsSelected = PositionIsSelected(this, position);
                    return;
                }

                base.OnBindViewHolder(holder, position);
            }

            public override void OnViewAttachedToWindow(JObject holder)
            {
                base.OnViewAttachedToWindow(holder);

                if (holder is TemplatedItemViewHolder templatedItemViewHolder)
                {
                    // Watch for clicks so the user can select the item held by this ViewHolder
                    // This replaces the click events triggered in SelectableItemViewHolder
                    // but still invokes SelectableItemsViewAdapter.SelectableClicked.
                    // I find these safer to use than click events when tied to Java objects.
                    templatedItemViewHolder.ItemView.SetOnClickListener(
                        ClickListener.With(
                            v => ViewHolderClicked(this, v, templatedItemViewHolder.AdapterPosition)));
                }
            }

            public override void OnViewDetachedFromWindow(JObject holder)
            {
                base.OnViewDetachedFromWindow(holder);

                if (holder is TemplatedItemViewHolder templatedItemViewHolder)
                {
                    templatedItemViewHolder.ItemView.SetOnClickListener(null);
                }
            }
        }
    }

Une meilleure solution à cela pourrait même être d'effacer la vue sur TemplatedItemViewHolder.Recycle , puis de tout exécuter à nouveau dans la branche templateChanging . Cela semble être une approche plus sûre, mais nécessiterait de réimplémenter un tas de choses si le changement n'est pas effectué dans la base de code XF. Je ne pense pas que le fait de croire que la vue et ses moteurs de rendu seront préservés entre Recycle et Bind sera fiable.

Je ne peux pas reprocher cela, mais la cause dans notre application était une liaison qui se déclenchait vers l'interface utilisateur en cours de suppression (supprimée de l'arborescence visuelle).
Heureusement pour nous, le mode de liaison ne devait être défini que sur OneTime pour résoudre le problème.

J'ai le même problème de plantage avec Xamarin.Forms 4.6.0.847.
J'obtiens cette trace de pile de crash lorsque je SfComboBox de Syncfusion (v18.2.0.44) . Je pense que l'étiquette se bloque.

@ Edgaras91 mon expérience utilisait également la syncfusion SfComboBox. Un élément sur le ItemTemplate liait IsVisible à une propriété sur le viewmodel (IsSelected).
Lorsqu'une nouvelle sélection a été effectuée - ce qui ferme la liste déroulante de la liste déroulante, la réinitialisation des propriétés IsSelected des modèles ItemSource liés provoquait le plantage.
Le changement du mode de liaison en OneTime a résolu le problème.

@ Edgaras91 mon expérience utilisait également la syncfusion SfComboBox. Un élément sur le ItemTemplate liait IsVisible à une propriété sur le viewmodel (IsSelected).
Lorsqu'une nouvelle sélection a été effectuée - ce qui ferme la liste déroulante de la liste déroulante, la réinitialisation des propriétés IsSelected des modèles ItemSource liés provoquait le plantage.
Le changement du mode de liaison en OneTime a résolu le problème.

Merci @InquisitorJax pour cela, cependant, le changement de mon modèle de liaison DataSource en OneTime n'a pas résolu mon problème de plantage.

Quelques informations supplémentaires sur la façon de reproduire ce plantage qui pourraient aider les autres:

Dans une vue avec SfComboBox et les données dans son DataSource, tout est stable.
Ensuite, lorsque j'ouvre un "popup" en utilisant Rg.Plugins.Popup en réutilisant le même ViewModel que BindingContext et en le laissant ouvert pendant 3 secondes et en fermant ce popup, puis en changeant la valeur de la SfComboBox originale 2 fois en sélectionnant dans le menu déroulant, cela lancera l'exception LabelRenderer.

La raison pour laquelle je ne publie pas encore sur Syncfusion est que l'exception est pure Xamarin Forms. Je n'ai pas encore essayé la solution de contournement suggérée pour la restauration de la version de Xamarin.

Je peux confirmer que pour moi XF 4.4.0.991864 ne l'a PAS corrigé, obtenant toujours la même exception.

Xamarin Forms 4.8.0.1364

JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) View.get_Context () Platform.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) Forms+AndroidPlatformServices.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) VisualElement.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) StackLayout.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) StackLayout.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) StackLayout.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) TemplatedView.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) Grid.CalculateAutoCells (System.Double width, System.Double height) Grid.MeasureGrid (System.Double width, System.Double height, System.Boolean requestSize) Grid.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) Layout.UpdateChildrenLayout () Layout.OnSizeAllocated (System.Double width, System.Double height) VisualElement.SizeAllocated (System.Double width, System.Double height) Layout.ResolveLayoutChanges () Thread+RunnableImplementor.Run () IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this)

Ce problème est reproductible dans les vues de collection avec des modèles d'élément. C'est devenu un bug critique pour nous.

Nous avons un sélecteur de modèle de vue de collection et les modèles se composent de composants extensibles et de plantages d'applications avec l'exception ci-dessous lorsque vous cliquez sur l'icône extensible.

Remarque: la capacité d'extension est obtenue simplement en définissant visible false et en définissant la taille de ligne de la grille parent sur Auto.

Non seulement LabelRenderer, il déclenche également une exception ImageRenderer, lorsqu'il n'y a pas d'étiquettes dans la vue extensible.

`09-10 20: 20: 28.104 E / AppCenterCrashes (23119): Exception non gérée de la source = AndroidEnvironment
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): System.ObjectDisposedException: Impossible d'accéder à un objet supprimé.
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): Nom de l'objet: «Xamarin.Forms.Platform.Android.FastRenderers.ImageRenderer».
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] dans: 0
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Java.Interop.JniPeerMembers + JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interopument.Jniue000] paramètres 0x00 *: 0
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): sur Android.Views.View.get_Context () [0x0000a] dans <55654ebe9f2a48e6bade2862bb243f94>: 0
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.Platform.Android.Platform.GetNativeSize (vue Xamarin.Forms.VisualElement, System.Double widthConstraint, System.Double heightConstraint) [0x00019] dans D : a1sXamarin.Forms.Platform.AndroidPlatform.cs: 1341
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.Forms + AndroidPlatformServices.GetNativeSize (vue Xamarin.Forms.VisualElement, System.Double widthConstraint, System.Double heightConstraint) [0x00000] dans D: a1sXamar .Forms.Platform.AndroidForms.cs: 921
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.VisualElement.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00025] dans D: a1sXamarin.Forms.CoreVisualElement.cs: 854
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.Image.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] dans D: a1sXamarin.Forms.CoreImage.cs: 74
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] dans D: a1sXamarin.Forms.CoreVisualElement.cs: 837
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] dans D: a1sXamarin.Forms.CoreVisualElement.cs: 713
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] dans D: a1sXamarin.Forms .CoreVisualElement.cs: 771
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.Grid.CalculateAutoCells (System.Double width, System.Double height) [0x002a3] dans D: a1sXamarin.Forms.CoreGridCalc.cs: 166
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.Grid.MeasureGrid (System.Double width, System.Double height, System.Boolean requestSize) [0x0000c] dans D: a1sXamarin.Forms.CoreGridCalc .cs: ​​576
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.Grid.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x0000e] dans D: a1sXamarin.Forms.CoreGridCalc.cs: 18
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.Layout.UpdateChildrenLayout () [0x00158] dans D: a1sXamarin.Forms.CoreLayout.cs: 266
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x0000f] dans D: a1sXamarin.Forms.CoreLayout.cs: 224
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] dans D: a1sXamarin.Forms.CoreVisualElement.cs: 859
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Xamarin.Forms.Layout.ResolveLayoutChanges () [0x0005c] dans D: a1sXamarin.Forms.CoreLayout.cs: 392
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Java.Lang.Thread + RunnableImplementor.Run () [0x00008] dans <55654ebe9f2a48e6bade2862bb243f94>: 0
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): à Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <55654ebe9f2a48e6bade2862bb243f94>: 0
09-10 20: 20: 28.104 E / AppCenterCrashes (23119): at (méthode dynamique du wrapper) Android.Runtime.DynamicMethodNameCounter.1 (intptr, intptr)

System.ObjectDisposedException: 'Impossible d'accéder à un objet supprimé.
Nom de l'objet: 'Xamarin.Forms.Platform.Android.FastRenderers.ImageRenderer'. ''

Il est tout à fait ridicule que la façon dont Microsoft puisse s'attendre à utiliser cette plate-forme pour créer une application d'entreprise avec un tel défaut de base se soit encore ouverte après tant de plaintes sur une si longue période!

Nous n'avons pas été en mesure de publier la mise à jour de notre version Android de l'application au cours des 4 derniers mois et tout ce que nous obtenons de ce fil est qu'ils ne peuvent pas reproduire cela, alors que le reste du monde le peut facilement !!!

Microsoft devrait arrêter de faire quoi que ce soit et tout avant que ce bogue puisse être corrigé. Publier une version plus récente de Xamarin est pratiquement inutile !!!

Ma solution de contournement à cette exception (tester les versions XF de 4.5.X à 4.8.X avant d'être sûr que le changement de version ne fonctionne pas):
POV: CarouselView (en tant que modal) conserve les étiquettes avec des numéros (sélection de la quantité de produit dans le panier). Ce contrôle s'affiche uniquement si l'utilisateur souhaite modifier la quantité. Cette exception se déclenchait lorsque le carrouselview masquait, mais était toujours "connecté" à la liaison List <> et SelectedItem.
Solution: remplir ce contrôle dans xaml.cs directement après le déclenchement de l'événement Clicked. De cette façon, ce contrôle n'est pas connecté à la classe ViewModel / PageModel.
Cette solution est une simulation de liaison:
`` `c #
// _counts est CarouselView
private void QuantityChangeTapped (expéditeur de l'objet, System.EventArgs e) // événement du bouton
{
CartItem item = (expéditeur en tant que View) .BindingContext as CartItem; // produit dans le panier dont la quantité va changer
_viewModel.Item = élément; // définir la quantité déjà enregistrée
_counts.ItemsSource = Enumerable.Range (1, item.QuantityRemaining) .ToList ();
_counts.Position = item.Quantity - 1; // fait défiler le carrousel jusqu'à la quantité déjà enregistrée
ShowSlider (); //Afficher le carrousel
}
private void CountApprouveClicked (expéditeur de l'objet, System.EventArgs e) // événement du bouton appelé "enregistrer la quantité sélectionnée"
{
CloseSlider ();
_viewModel.SelectedCount = (int) _counts.CurrentItem;
_viewModel.OnCountApprouve.Execute (null);
}

''

J'ai rencontré à nouveau celui-ci - seulement il n'y avait aucun contrôle de Syncfusion impliqué.
Simplement un élément sur un DataTemplate qui avait une liaison IsVisible avec le ViewModel.
La solution était la même: définissez BindingMode sur OneTime.

Quelqu'un qui voit ce problème peut-il tester avec la nuget ici?

https://dev.azure.com/xamarin/public/_build/results?buildId=25860&view=artifacts&type=publishedArtifacts

Et puis s'il vous plaît laissez-moi savoir si vous voyez toujours l'exception?

Quelqu'un qui voit ce problème peut-il tester avec la nuget ici?

https://dev.azure.com/xamarin/public/_build/results?buildId=25860&view=artifacts&type=publishedArtifacts

Et puis s'il vous plaît laissez-moi savoir si vous voyez toujours l'exception?

Je viens d'essayer la pépite que vous avez publiée et une exception continue de se produire, la seule différence par rapport à l'exception précédente est qu'au lieu de faire référence à Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer, l'exception fait maintenant référence à Xamarin.Forms.Platform.Android. Platform + DefaultRenderer

Nouvelle exception:

System.ObjectDisposedException: 'Cannot access a disposed object.
Object name: 'Xamarin.Forms.Platform.Android.Platform+DefaultRenderer'.'

Ancienne exception:

System.ObjectDisposedException: 'Cannot access a disposed object.
Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.'

@nacompllo pouvez-vous publier l'intégralité du stacktrace? Je me rends compte que ce n'est probablement qu'une seule ligne qui est différente mais il serait toujours utile d'avoir la trace complète ici

@PureWeen J'ai testé le nuget et il plante toujours mais la pile est un peu différente

09-12 22:30:00.522 I/MonoDroid( 5147): UNHANDLED EXCEPTION:
09-12 22:30:00.524 I/MonoDroid( 5147): System.ObjectDisposedException: Cannot access a disposed object.
09-12 22:30:00.524 I/MonoDroid( 5147): Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.
09-12 22:30:00.524 I/MonoDroid( 5147):   at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <42748fcc36b74733af2d9940a8f3cc8e>:0 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <42748fcc36b74733af2d9940a8f3cc8e>:0 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Android.Views.View.get_Context () [0x0000a] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Xamarin.Forms.Platform.Android.Platform.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x0001b] in D:\agent\1\s\Xamarin.Forms.Platform.Android\Platform.cs:1345 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Xamarin.Forms.Forms+AndroidPlatformServices.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x00001] in D:\agent\1\s\Xamarin.Forms.Platform.Android\Forms.cs:921 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Xamarin.Forms.VisualElement.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x0002d] in D:\agent\1\s\Xamarin.Forms.Core\VisualElement.cs:814 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00001] in D:\agent\1\s\Xamarin.Forms.Core\VisualElement.cs:799 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00070] in D:\agent\1\s\Xamarin.Forms.Core\VisualElement.cs:689 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00064] in D:\agent\1\s\Xamarin.Forms.Core\VisualElement.cs:741 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion (Xamarin.Forms.VisualElement child, Xamarin.Forms.Rectangle region) [0x0009d] in D:\agent\1\s\Xamarin.Forms.Core\Layout.cs:133 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Xamarin.Forms.Grid.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x00177] in D:\agent\1\s\Xamarin.Forms.Core\GridCalc.cs:49 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x00173] in D:\agent\1\s\Xamarin.Forms.Core\Layout.cs:239 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x00011] in D:\agent\1\s\Xamarin.Forms.Core\Layout.cs:203 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\agent\1\s\Xamarin.Forms.Core\VisualElement.cs:817 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Xamarin.Forms.Layout.ResolveLayoutChanges () [0x0008b] in D:\agent\1\s\Xamarin.Forms.Core\Layout.cs:374 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Xamarin.Forms.Platform.Android.Platform+DefaultRenderer.OnMeasure (System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00016] in D:\agent\1\s\Xamarin.Forms.Platform.Android\Platform.cs:1309 
09-12 22:30:00.524 I/MonoDroid( 5147):   at Android.Views.View.n_OnMeasure_II (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00008] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 
09-12 22:30:00.524 I/MonoDroid( 5147):   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.28(intptr,intptr,int,int)
09-12 22:30:00.532 E/AppCenterCrashes( 5147): Unhandled Exception from source=AndroidEnvironment
09-12 22:30:00.532 E/AppCenterCrashes( 5147): System.ObjectDisposedException: Cannot access a disposed object.
09-12 22:30:00.532 E/AppCenterCrashes( 5147): Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <42748fcc36b74733af2d9940a8f3cc8e>:0 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <42748fcc36b74733af2d9940a8f3cc8e>:0 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Android.Views.View.get_Context () [0x0000a] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Xamarin.Forms.Platform.Android.Platform.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x0001b] in D:\agent\1\s\Xamarin.Forms.Platform.Android\Platform.cs:1345 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Xamarin.Forms.Forms+AndroidPlatformServices.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x00001] in D:\agent\1\s\Xamarin.Forms.Platform.Android\Forms.cs:921 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Xamarin.Forms.VisualElement.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x0002d] in D:\agent\1\s\Xamarin.Forms.Core\VisualElement.cs:814 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00001] in D:\agent\1\s\Xamarin.Forms.Core\VisualElement.cs:799 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00070] in D:\agent\1\s\Xamarin.Forms.Core\VisualElement.cs:689 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00064] in D:\agent\1\s\Xamarin.Forms.Core\VisualElement.cs:741 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion (Xamarin.Forms.VisualElement child, Xamarin.Forms.Rectangle region) [0x0009d] in D:\agent\1\s\Xamarin.Forms.Core\Layout.cs:133 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Xamarin.Forms.Grid.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x00177] in D:\agent\1\s\Xamarin.Forms.Core\GridCalc.cs:49 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x00173] in D:\agent\1\s\Xamarin.Forms.Core\Layout.cs:239 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x00011] in D:\agent\1\s\Xamarin.Forms.Core\Layout.cs:203 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\agent\1\s\Xamarin.Forms.Core\VisualElement.cs:817 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Xamarin.Forms.Layout.ResolveLayoutChanges () [0x0008b] in D:\agent\1\s\Xamarin.Forms.Core\Layout.cs:374 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Xamarin.Forms.Platform.Android.Platform+DefaultRenderer.OnMeasure (System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00016] in D:\agent\1\s\Xamarin.Forms.Platform.Android\Platform.cs:1309 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at Android.Views.View.n_OnMeasure_II (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00008] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 
09-12 22:30:00.532 E/AppCenterCrashes( 5147):   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.28(intptr,intptr,int,int)
09-12 22:30:00.539 D/Mono    ( 5147): Requesting loading reference 5 (of 6) of /storage/emulated/0/Android/data/com.Tandem.DoKapsyApp/files/.__override__/Microsoft.AppCenter.Crashes.dll
09-12 22:30:00.539 D/Mono    ( 5147): Loading reference 5 of /storage/emulated/0/Android/data/com.Tandem.DoKapsyApp/files/.__override__/Microsoft.AppCenter.Crashes.dll asmctx DEFAULT, looking for System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
09-12 22:30:00.539 D/Mono    ( 5147): Assembly Ref addref Microsoft.AppCenter.Crashes[0xec37f580] -> System.Core[0xec37e8c0]: 11
09-12 22:30:00.634 D/Mono    ( 5147): DllImport searching in: '__Internal' ('(null)').
09-12 22:30:00.634 D/Mono    ( 5147): Searching for 'java_interop_jnienv_throw'.
09-12 22:30:00.634 D/Mono    ( 5147): Probing 'java_interop_jnienv_throw'.
09-12 22:30:00.634 D/Mono    ( 5147): Found as 'java_interop_jnienv_throw'.
**System.ObjectDisposedException:** 'Cannot access a disposed object.
Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.'


=================================================================
    Native Crash Reporting
=================================================================
Got a SEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

No native Android stacktrace (see debuggerd output).

=================================================================
    Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0xe79167fa):0xe79167ea  00 00 00 c7 47 18 00 00 00 00 74 7a 8b 3a 31 d2  ....G.....tz.:1.
0xe79167fa  8b 4f 04 f7 c1 00 01 00 00 0f 84 28 f9 ff ff a8  .O.........(....
0xe791680a  01 0f 85 c1 00 00 00 8b 57 18 85 d2 0f 84 de fd  ........W.......
0xe791681a  ff ff 8b b3 04 3b 00 00 3b 93 ac fb ff ff 8b 86  .....;..;.......

=============================================================09-12 22:30:01.742 I/MonoDroid( 5147): UNHANDLED EXCEPTION:

====
    Managed Stacktrace:
=================================================================
      at <unknown> <0xffffffff>
      at Java.Interop.NativeMethods:java_interop_jnienv_new_string <0x00012>
      at Strings:NewString <0x00077>
      at Strings:NewString <0x00147>
      at Android.Runtime.JNIEnv:NewString <0x0008f>
      at Java.Lang.Error:.ctor <0x000ff>
      at Android.Runtime.JavaProxyThrowable:.ctor <0x00067>
      at Java.Lang.Throwable:FromException <0x0012f>
      at Android.Runtime.AndroidEnvironment:UnhandledException <0x0039b>
      at Android.Runtime.DynamicMethodNameCounter:28 <0x00163>
      at Android.Runtime.DynamicMethodNameCounter:28 <0x000bf>
      at <unknown> <0xffffffff>
      at Java.Interop.NativeMethods:java_interop_jnienv_call_nonvirtual_void_method_a <0x00015>
      at InstanceMethods:CallNonvirtualVoidMethod <0x00353>
      at JniInstanceMethods:InvokeNonvirtualVoidMethod <0x00127>
      at Android.Views.View:Measure <0x00197>
      at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer:OnLayout <0x0037f>
      a09-12 22:30:01.743 I/MonoDroid( 5147): System.ObjectDisposedException: Cannot access a disposed object.

t Xamarin.Forms.Platform.Android.FormsViewGroup:n_OnLayout_ZIIII <0x000ca>
      at Android.Runtime.DynamicMethodNameCounter:40 <0x00147>
      at Android.Runtime.DynamicMethodNameCounter:40 <0x000f3>
      at <unknown> <0xffffffff>
      at Java.Interop.NativeMethods:java_interop_jnienv_call_nonvirtual_void_method_a <0x00015>
      at InstanceMethods:CallNonvirtualVoidMethod <0x00353>
      at JniInstanceMethods:InvokeVirtualVoidMethod <0x002df>
      at Xamarin.Forms.Platform.Android.FormsViewGroup:MeasureAndLayout <0x00397>
      at Xamarin.Forms.Platform.Android.VisualElementTracker:UpdateLayout <0x00797>
      at Xamarin.Forms.Platform.Android.VisualElementRenderer`1:UpdateLayout <0x000c3>
      at Xamarin.Forms.Platform.Android.MasterDetailContainer:OnLayout <0x003c6>
      at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailContainer:OnLayout <0x000db>
      at Android.Views.ViewGroup:n_OnLayout_ZIIII <0x000aa>
      at Android.Runtime.DynamicMethodNameCounter:27 <0x00147>
      at Android.Runtime.DynamicMethodNameCounter:27 <0x000f3>
      a09-12 22:30:01.743 I/MonoDroid( 5147): Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.

t <unknown> <0xffffffff>
      at Java.Interop.NativeMethods:java_interop_jnienv_call_nonvirtual_void_method_a <0x00015>
      at InstanceMethods:CallNonvirtualVoidMethod <0x00353>
      at JniInstanceMethods:InvokeVirtualVoidMethod <0x002df>
      at AndroidX.DrawerLayout.Widget.DrawerLayout:OnLayout <0x002eb>
      at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRenderer:OnLayout <0x00087>
      at AndroidX.DrawerLayout.Widget.DrawerLayout:n_OnLayout_ZIIII <0x000aa>
      at Android.Runtime.DynamicMethodNameCounter:31 <0x00147>
      at Android.Runtime.DynamicMethodNameCounter:31 <0x000f3>
      at <unknown> <0xffffffff>
      at Java.Interop.NativeMethods:java_interop_jnienv_call_nonvirtual_void_method_a <0x00015>
      at InstanceMethods:CallNonvirtualVoidMethod <0x00353>
      at JniInstanceMethods:InvokeNonvirtualVoidMethod <0x00127>
      at Android.Views.ViewGroup:Layout <0x00277>
      at Xamarin.Forms.Platform.Android.VisualElementTracker:UpdateLayout <0x0061a>
      at Xamarin.Forms.Platform.Android.AppCompat.MasterDetailPageRende09-12 22:30:01.743 I/MonoDroid( 5147):   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.28(intptr,intptr,int,int)

rer:Xamarin.Forms.Platform.Android.IVisualElementRenderer.UpdateLayout <0x00067>
      at Xamarin.Forms.Platform.Android.AppCompat.Platform:Xamarin.Forms.Platform.Android.IPlatformLayout.OnLayout <0x00184>
      at Xamarin.Forms.Platform.Android.PlatformRenderer:OnLayout <0x00119>
      at Android.Views.ViewGroup:n_OnLayout_ZIIII <0x000aa>
      at Android.Runtime.DynamicMethodNameCounter:27 <0x00147>
      at Android.Runtime.DynamicMethodNameCounter:27 <0x000f3>
=================================================================09-12 22:30:01.743 I/MonoDroid( 5147):   at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.28(intptr,intptr,int,int)

09-12 22:30:01.743 I/MonoDroid( 5147):   at (wrapper managed-to-native) Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a(intptr,intptr&,intptr,intptr,intptr,intptr)
09-12 22:30:01.743 I/MonoDroid( 5147):   at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00079] in <42748fcc36b74733af2d9940a8f3cc8e>:0 
09-12 22:30:01.743 I/MonoDroid( 5147):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0001f] in <42748fcc36b74733af2d9940a8f3cc8e>:0 
09-12 22:30:01.743 I/MonoDroid( 5147):   at Android.Views.View.Measure (System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00035] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 
09-12 22:30:01.743 I/MonoDroid( 5147):   at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer+Container.OnMeasure (System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x000d0] in D:\agent\1\s\Xamarin.Forms.Platform.Android\AppCompat\NavigationPageRenderer.cs:1223 
09-12 22:30:01.743 I/MonoDroid( 5147):   at Android.Views.View.n_OnMeasure_II (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00008] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 
09-12 22:30:01.743 I/MonoDroid( 5147):   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.28(intptr,intptr,int,int)
09-12 22:30:01.746 F/libc    ( 5147): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x6f726578 in tid 5147 (ndem.DoKapsyApp), pid 5147 (ndem.DoKapsyApp)
[HotReload] (2020-09-12 22:30:03.9): INFO: (Tandem.DoKapsyApp.Android) Stopped Hot Reload session due to ExplicitlyEnded ...

@PureWeen
Je joins toutes les informations que je reçois de la fenêtre de sortie:

09-13 12: 37: 30.755 I / MonoDroid (21323): EXCEPTION NON GÉRÉE:
09-13 12: 37: 30.758 I / MonoDroid (21323): System.ObjectDisposedException: impossible d'accéder à un objet supprimé.
09-13 12: 37: 30.759 I / MonoDroid (21323): Nom de l'objet: «Xamarin.Forms.Platform.Android.Platform + DefaultRenderer».
09-13 12: 37: 30.759 I / MonoDroid (21323): at (méthode dynamique du wrapper) Android.Runtime.DynamicMethodNameCounter.33 (intptr, intptr, bool, int, int, int, int)
09-13 12: 37: 30.759 I / MonoDroid (21323): at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.33 (intptr, intptr, int, int, int, int, int)
09-13 12: 37: 30.759 I / MonoDroid (21323): at (wrapper managed-to-native) Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a (intptr, intptr &, intptr, intptr, intptr, intptr)
09-13 12: 37: 30.759 I / MonoDroid (21323): à Java.Interop.JniEnvironment + InstanceMethods.CallNonvirtualVoidMethod (instance Java.Interop.JniObjectReference, type Java.Interop.JniObjectReference, méthode Java.InteropInterop.Jni .JniArgumentValue * args) [0x00079] dans <42748fcc36b74733af2d9940a8f3cc8e>: 0
09-13 12: 37: 30.759 I / MonoDroid (21323): à Java.Interop.JniPeerMembers + JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue * paramètres 0x0005) <42748fcc36b74733af2d9940a8f3cc8e>: 0
09-13 12: 37: 30.759 I / MonoDroid (21323): à Xamarin.Forms.Platform.Android.FormsViewGroup.MeasureAndLayout (System.Int32 p0, System.Int32 p1, System.Int32 p2, System.Int32 p3, System. Int32 p4, System.Int32 p5) [0x00088] dans D: agent1sXamarin.Forms.Platform.Android.FormsViewGroupobjDebuggeneratedsrcXamarin.Forms.Platform.Android.FormsViewGroup.cs: 181
09-13 12: 37: 30.759 I / MonoDroid (21323): à Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout () [0x0015c] dans D: agent1sXamarin.Forms.Platform.AndroidVisualElementTracker.cs: 111
09-13 12: 37: 30.759 I / MonoDroid (21323): à Xamarin.Forms.Platform.Android.VisualElementRenderer`1 [TElement] .UpdateLayout () [0x00014] dans D: agent1sXamarin.Forms.Platform.AndroidVisualElementRenderer.cs: 139
09-13 12: 37: 30.759 I / MonoDroid (21323): à Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms.Platform.Android.IPlatformLayout.OnLayout (System.Boolean changé, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x0002f] dans D: agent1sXamarin.Forms.Platform.AndroidAppCompatPlatform.cs: 235
09-13 12: 37: 30.759 I / MonoDroid (21323): à Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout (System.Boolean a changé, System.Int32 l, System.Int32 t, System.Int32 r, System. Int32 b) [0x0001d] dans D: agent1sXamarin.Forms.Platform.AndroidPlatformRenderer.cs: 75
09-13 12: 37: 30.759 I / MonoDroid (21323): sur Android.Views.ViewGroup.n_OnLayout_ZIIII (System.IntPtr jnienv, System.IntPtr native__this, System.Boolean changé, System.Int32 l, System.Int32 t, System .Int32 r, System.Int32 b) [0x00008] dans <7d2292394f8c488b97f5bc2a0ac0240d>: 0
09-13 12: 37: 30.759 I / MonoDroid (21323): at (méthode dynamique du wrapper) Android.Runtime.DynamicMethodNameCounter.27 (intptr, intptr, bool, int, int, int, int)
System.ObjectDisposedException: 'Impossible d'accéder à un objet supprimé.
Nom de l'objet: 'Xamarin.Forms.Platform.Android.Platform + DefaultRenderer'. '

09-13 12: 37: 33.822 E / mono (21323):
09-13 12: 37: 33.822 E / mono (21323): Exception non gérée:
09-13 12: 37: 33.822 E / mono (21323): System.ObjectDisposedException: Impossible d'accéder à un objet supprimé.
09-13 12: 37: 33.822 E / mono (21323): Nom de l'objet: 'Xamarin.Forms.Platform.Android.Platform + DefaultRenderer'.
09-13 12: 37: 33.822 E / mono (21323): at (méthode dynamique du wrapper) Android.Runtime.DynamicMethodNameCounter.33 (intptr, intptr, bool, int, int, int, int)
09-13 12: 37: 33.822 E / mono (21323): at (wrapper natif à géré) Android.Runtime.DynamicMethodNameCounter.33 (intptr, intptr, int, int, int, int, int)
09-13 12: 37: 33.822 E / mono (21323): at (wrapper managed-to-native) Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a (intptr, intptr &, intptr, intptr, intptr, intptr)
09-13 12: 37: 33.822 E / mono (21323): sur Java.Interop.JniEnvironment + InstanceMethods.CallNonvirtualVoidMethod (instance Java.Interop.JniObjectReference, type Java.Interop.JniObjectReference, Java.Interopter.JniMethodInfo, méthode Java.Interopter.JniMethodInfo .JniArgumentValue * args) [0x00079] dans <42748fcc36b74733af2d9940a8f3cc8e>: 0
09-13 12: 37: 33.822 E / mono (21323): à Java.Interop.JniPeerMembers + JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue * paramètres) [paramètres Java.Interop.JniArgumentValue *] <42748fcc36b74733af2d9940a8f3cc8e>: 0
09-13 12: 37: 33.822 E / mono (21323): à Xamarin.Forms.Platform.Android.FormsViewGroup.MeasureAndLayout (System.Int32 p0, System.Int32 p1, System.Int32 p2, System.Int32 p3, System. Int32 p4, System.Int32 p5) [0x00088] dans D: agent1sXamarin.Forms.Platform.Android.FormsViewGroupobjDebuggeneratedsrcXamarin.Forms.Platform.Android.FormsViewGroup.cs: 181
09-13 12: 37: 33.822 E / mono (21323): à Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout () [0x0015c] dans D: agent1sXamarin.Forms.Platform.AndroidVisualElementTracker.cs: 111
09-13 12: 37: 33.822 E / mono (21323): à Xamarin.Forms.Platform.Android.VisualElementRenderer 1[TElement].UpdateLayout () [0x00014] in D:\agent\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:139 09-13 12:37:33.822 E/mono (21323): at Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms.Platform.Android.IPlatformLayout.OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x0002f] in D:\agent\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:235 09-13 12:37:33.822 E/mono (21323): at Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x0001d] in D:\agent\1\s\Xamarin.Forms.Platform.Android\PlatformRenderer.cs:75 09-13 12:37:33.822 E/mono (21323): at Android.Views.ViewGroup.n_OnLayout_ZIIII (System.IntPtr jnienv, System.IntPtr native__this, System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x00008] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 09-13 12:37:33.822 E/mono (21323): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.27(intptr,intptr,bool,int,int,int,int) 09-13 12:37:33.822 E/mono (21323): --- End of stack trace from previous location where exception was thrown --- 09-13 12:37:33.822 E/mono (21323): 09-13 12:37:33.822 E/mono (21323): at Java.Interop.JniEnvironment+Strings.NewString (System.Char* unicodeChars, System.Int32 length) [0x0001e] in <42748fcc36b74733af2d9940a8f3cc8e>:0 09-13 12:37:33.822 E/mono (21323): at Java.Interop.JniEnvironment+Strings.NewString (System.String value) [0x00024] in <42748fcc36b74733af2d9940a8f3cc8e>:0 09-13 12:37:33.822 E/mono (21323): at Android.Runtime.JNIEnv.NewString (System.String text) [0x00009] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 09-13 12:37:33.822 E/mono (21323): at Java.Lang.Error..ctor (System.String message) [0x0001f] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 09-13 12:37:33.822 E/mono (21323): at Android.Runtime.JavaProxyThrowable..ctor (System.Exception innerException) [0x00007] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 09-13 12:37:33.822 E/mono (21323): at Java.Lang.Throwable.FromException (System.Exception e) [0x0001d] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 09-13 12:37:33.822 E/mono (21323): at Android.Runtime.AndroidEnvironment.UnhandledException (System.Exception e) [0x00067] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 09-13 12:37:33.822 E/mono (21323): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.27(intptr,intptr,bool,int,int,int,int) 09-13 12:37:33.822 E/mono (21323): at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.27(intptr,intptr,int,int,int,int,int) 09-13 12:37:33.826 E/mono-rt (21323): [ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: Cannot access a disposed object. 09-13 12:37:33.826 E/mono-rt (21323): Object name: 'Xamarin.Forms.Platform.Android.Platform+DefaultRenderer'. 09-13 12:37:33.826 E/mono-rt (21323): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.33(intptr,intptr,bool,int,int,int,int) 09-13 12:37:33.826 E/mono-rt (21323): at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.33(intptr,intptr,int,int,int,int,int) 09-13 12:37:33.826 E/mono-rt (21323): at (wrapper managed-to-native) Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a(intptr,intptr&,intptr,intptr,intptr,intptr) 09-13 12:37:33.826 E/mono-rt (21323): at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00079] in <42748fcc36b74733af2d9940a8f3cc8e>:0 09-13 12:37:33.826 E/mono-rt (21323): at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in <42748fcc36b74733af2d9940a8f3cc8e>:0 09-13 12:37:33.826 E/mono-rt (21323): at Xamarin.Forms.Platform.Android.FormsViewGroup.MeasureAndLayout (System.Int32 p0, System.Int32 p1, System.Int32 p2, System.Int32 p3, System.Int32 p4, System.Int32 p5) [0x00088] in D:\agent\1\s\Xamarin.Forms.Platform.Android.FormsViewGroup\obj\Debug\generated\src\Xamarin.Forms.Platform.Android.FormsViewGroup.cs:181 09-13 12:37:33.826 E/mono-rt (21323): at Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout () [0x0015c] in D:\agent\1\s\Xamarin.Forms.Platform.Android\VisualElementTracker.cs:111 09-13 12:37:33.826 E/mono-rt (21323): at Xamarin.Forms.Platform.Android.VisualElementRenderer 1 [TElement] .UpdateLayout () [0x00014] dans D: agent1sXamarin.Forms.Platform .AndroidVisualElementRenderer.cs: 139
09-13 12: 37: 33.826 E / mono-rt (21323): à Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms.Platform.Android.IPlatformLayout.OnLayout (System.Boolean modifié, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x0002f] dans D: agent1sXamarin.Forms.Platform.AndroidAppCompatPlatform.cs: 235
09-13 12: 37: 33.826 E / mono-rt (21323): à Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout (System.Boolean a changé, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x0001d] dans D: agent1sXamarin.Forms.Platform.AndroidPlatformRenderer.cs: 75
09-13 12: 37: 33.826 E / mono-rt (21323): sur Android.Views.ViewGroup.n_OnLayout_ZIIII (System.IntPtr jnienv, System.IntPtr native__this, System.Boolean changé, System.Int32 l, System.Int32 t , System.Int32 r, System.Int32 b) [0x00008] dans <7d2292394f8c488b97f5bc2a0ac0240d>: 0
09-13 12: 37: 33.826 E / mono-rt (21323): at (méthode-dynamique du wrapper) Android.Runtime.DynamicMethodNameCounter.27 (intptr, intptr, bool, int, int, int, int)
09-13 12: 37: 33.826 E / mono-rt (21323): --- Fin de la trace de pile à partir de l'emplacement précédent où l'exception a été lancée ---
09-13 12: 37: 33.826 E / mono-rt (21323):
09-13 12: 37: 33.826 E / mono-rt (21323): à Java.Interop.JniEnvironment + Strings.NewString (System.Char * unicodeChars, System.Int32 length) [0x0001e] in <42748fcc36b74733af2d9940a8f3cc8e>: 0
09-13 12: 37: 33.826 E / mono-rt (21323): à Java.Interop.JniEnvironment + Strings.NewString (valeur System.String) [0x00024] dans <42748fcc36b74733af2d9940a8f3cc8e>: 0
09-13 12: 37: 33.826 E / mono-rt (21323): sur Android.Runtime.JNIEnv.NewString (System.String text) [0x00009] in <7d2292394f8c488b97f5bc2a0ac0240d>: 0
09-13 12: 37: 33.826 E / mono-rt (21323): à Java.Lang.Error..ctor (message System.String) [0x0001f] dans <7d2292394f8c488b97f5bc2a0ac0240d>: 0
09-13 12: 37: 33.826 E / mono-rt (21323): sur Android.Runtime.JavaProxyThrowable..ctor (System.Exception innerException) [0x00007] dans <7d2292394f8c488b97f5bc2a0ac0240d>: 0
09-13 12: 37: 33.826 E / mono-rt (21323): à Java.Lang.Throwable.FromException (System.Exception e) [0x0001d] dans <7d2292394f8c488b97f5bc2a0ac0240d>: 0
09-13 12: 37: 33.826 E / mono-rt (21323): sur Android.Runtime.AndroidEnvironment.UnhandledException (System.Exception e) [0x00067] dans <7d2292394f8c488b97f5bc2a0ac0240d>: 0
09-13 12: 37: 33.826 E / mono-rt (21323): at (méthode-dynamique du wrapper) Android.Runtime.DynamicMethodNameCounter.27 (intptr, intptr, bool, int, int, int, int) se terminant

09-13 12: 37: 33.826 E / mono-rt (21323): at (wrapper natif à géré) Android.Runtime.DynamicMethodNameCounter.27 (intptr, intptr, int, int, int, int, int)
09-13 12: 37: 33.865 E / libc ++ abi (21323): fin
09-13 12: 37: 33.866 F / libc (21323): Signal fatal 6 (SIGABRT), code -1 (SI_QUEUE) dans tid 21323 (ame.labelrender), pid 21323 (ame.labelrender)

@nacompllo @Reveon

Essayez celui-ci et faites-le moi savoir s'il vous plaît!

https://dev.azure.com/xamarin/public/_build/results?buildId=26573&view=artifacts&type=publishedArtifacts

@nacompllo @Reveon

Essayez celui-ci et faites-le moi savoir s'il vous plaît!

https://dev.azure.com/xamarin/public/_build/results?buildId=26573&view=artifacts&type=publishedArtifacts

@PureWeen
Je viens de faire le test avec la nouvelle nuget et il semble que le problème a été résolu ne se reproduit plus, il semble que cette nuget résout ce problème. Bon travail.

@PureWeen j'ai fait un test rapide et il semble que les exceptions ont disparu

@PureWeen je confirme également que pour le moment mon application ne déclenche pas cette exception après des tests rapides.

Impressionnant!!

@PureWeen , Exception ne se produit plus avec les nugets fournis. Légende.

Quelqu'un peut-il expliquer comment installer ce «nuget» sur Xamarin Forms?

@ Edgaras91 jetez un œil à ce sujet

@ Edgaras91 ,
Clique sur le lien.
Sur la droite du panneau "nuget", il y aura le bouton "plus" (3 points verticaux), dans le menu contextuel, sélectionnez "télécharger [...]".
Ensuite, définissez (comme @Reveon l'a mentionné) la source locale des nugets locaux dans vos fichiers système (par exemple "C: reposlocalNugets") et placez le contenu du zip téléchargé dans ce dossier (il y aura quelques fichiers Xamarin .nupkg).
Ensuite, dans votre VS, ouvrez le gestionnaire NuGet et à partir de cette liste déroulante
obraz
sélectionnez votre source locale (la mienne s'appelle simplement "locale")
Enfin, installez / mettez à jour Xamarin.Forms sur le projet sélectionné comme d'habitude.

Merci @Reveon et @BartoszKopec . Cependant, j'ai également des intégrations continues Dev Ops, ce sera amusant. J'espère que ce correctif est approuvé et sera déployé dès que possible!

@ Edgaras91 J'utilise App Center comme CI et j'ai le même problème - je ne peux pas l'utiliser! 😄

Peut également confirmer que cela semble être résolu.
@PureWeen savons -nous ce que serait plus ou moins l'

  • excellent travail pour clouer la cause btw;)

Salut,
Pour les personnes qui ont ce problème: dans mon cas, j'avais plusieurs étiquettes qui ont changé de visibilité via IsVisible .
Je l'ai changé pour BackGroundColor et TextColor est Color.Transparent ou non, et le problème a disparu…
J'espère que cela t'aides ...

Ce correctif sera-t-il inclus dans le prochain 4.8? Ou juste 5,0?

SR suivant sur 4.8

La même exception sur 4.8.0.1451:

{InnerException: null  StackTrace:   at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <324349c9a2dd47568c91620d2bd3db5a>:0 
  at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <324349c9a2dd47568c91620d2bd3db5a>:0 
  at Android.Views.View.get_Context () [0x0000a] in <f69f42e19d884caca4279f1717610a26>:0 
  at Xamarin.Forms.Platform.Android.Platform.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x00019] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:1341 
  at Xamarin.Forms.Forms+AndroidPlatformServices.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\Forms.cs:921 
  at Xamarin.Forms.VisualElement.OnSizeRequest (Syst


    at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <324349c9a2dd47568c91620d2bd3db5a>:0 
  at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <324349c9a2dd47568c91620d2bd3db5a>:0 
  at Android.Views.View.get_Context () [0x0000a] in <f69f42e19d884caca4279f1717610a26>:0 
  at Xamarin.Forms.Platform.Android.Platform.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x00019] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:1341 
  at Xamarin.Forms.Forms+AndroidPlatformServices.GetNativeSize (Xamarin.Forms.VisualElement view, System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\Forms.cs:921 
  at Xamarin.Forms.VisualElement.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00025] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:811 
  at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:796 
  at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:686 
  at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:738 
  at Xamarin.Forms.StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) [0x00236] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:198 
  at Xamarin.Forms.StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) [0x00058] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:123 
  at Xamarin.Forms.StackLayout.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00019] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:80 
  at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:796 
  at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:686 
  at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:113 
  at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:738 
  at Xamarin.Forms.StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) [0x000a8] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:163 
  at Xamarin.Forms.StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) [0x00058] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:123 
  at Xamarin.Forms.StackLayout.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00019] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:80 
  at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:796 
  at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:686 
  at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:113 
  at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:738 
  at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion (Xamarin.Forms.VisualElement child, Xamarin.Forms.Rectangle region) [0x0007b] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:133 
  at Xamarin.Forms.TemplatedView.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x00019] in D:\a\1\s\Xamarin.Forms.Core\TemplatedView.cs:29 
  at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x00158] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:239 
  at Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:203 
  at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:814 
  at Xamarin.Forms.Layout.ResolveLayoutChanges () [0x0005c] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:362 
  at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <f69f42e19d884caca4279f1717610a26>:0 
  at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <f69f42e19d884caca4279f1717610a26>:0 
  at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.36(intptr,intptr)


  Cannot access a disposed object.
Object name: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'.


Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer

Java.Interop

System.ObjectDisposedException

Ce n'est pas dans cette version, vous devrez attendre Xamarin Forms 4.8 Service Release 3

Ce n'est pas dans cette version, vous devrez attendre Xamarin Forms 4.8 Service Release 3

@joshuangfraedom Vous voulez dire que ce problème est résolu dans Xamarin Forms 4.8 Service Release 3?

Quand est-il prévu de le publier? Combien de temps à attendre ... :-)))

Je ne suis pas sûr désolé, il semble que le correctif pour cela se trouve actuellement dans XF 5.0 Prerelease 1 si vous vouliez essayer. @samhouts pouvons-nous obtenir une mise à jour sur une autre version de service pour 4.8?

J'ai testé un projet avec la même erreur, Xamarin 5.0.0.1539-pre2 et il persiste toujours

System.ObjectDisposedException: Cannot access a dropped object

En utilisant cette ligne Forms.SetFlags ("UseLegacyRenderers") dans le projet, l'exception a le ObjectName:
Xamarin.Forms.Platform.Android.AppCompat.FrameRenderer

Sans la ligne d'indicateur le ObjectName:
Xamarin.Forms.Platform.Android.FastRenderers.FrameRenderer

@TsplayerT Pouvez-vous publier la trace complète de la pile?

C'est ici:

| Fil principal | Détails |
| ------------------- | ------------------- |
| Java.Interop | JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) |
| Java.Interop | JniPeerMembers + JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, paramètres Java.Interop.JniArgumentValue *) |
| Android.Views | View.set_Enabled (valeur System.Boolean) |
| Xamarin.Forms.Platform.Android.FastRenderers | VisualElementRenderer.UpdateIsEnabled () |
| Xamarin.Forms.Platform.Android.FastRenderers | VisualElementRenderer.OnElementPropertyChanged (expéditeur System.Object, System.ComponentModel.PropertyChangedEventArgs e) (délégué-appel de wrapper.invoke_void_object_PropertyChangedEventArgs (objet, System.ComponentModel.PropertyChangedEventArgs) |
| Xamarin.Forms | BindableObject.OnPropertyChanged (System.String propertyName) |
| Xamarin.Forms | Element.OnPropertyChanged (System.String propertyName) |
| Xamarin.Forms | BindableObject.SetValueActual (propriété Xamarin.Forms.BindableProperty, Xamarin.Forms.BindableObject + BindablePropertyContext contexte, valeur System.Object, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags silent, attributs System.Boolean.SetValueFlags silent)
| Xamarin.Forms | BindableObject.SetValueCore (propriété Xamarin.Forms.BindableProperty, valeur System.Object, attributs Xamarin.Forms.Internals.SetValueFlags, Xamarin.Forms.BindableObject + SetValuePrivateFlags privateAttributes) |
| Xamarin.Forms | BindingExpression.ApplyCore (System.Object sourceObject, cible Xamarin.Forms.BindableObject, propriété Xamarin.Forms.BindableProperty, System.Boolean fromTarget) |
| Xamarin.Forms | BindingExpression.Apply (System.Boolean fromTarget) |
| Xamarin.Forms | BindingExpression + BindingExpressionPart.b__49_0 () |
| Java.Lang | Thread + RunnableImplementor.Run () |
| Java.Lang | IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) (méthode-dynamique de wrapper) Android.Runtime.DynamicMethodNameCounter.24 (intptr, intptr) |

Les détails de l'erreur et d'autres informations sont joints. report.txt

Cela devrait être rouvert. Je peux également le reproduire sur 5.0.0.1558-pre3.
Gardez à l'esprit que j'ai le cas suivant - j'ai quelques éléments (étiquette incl.) À l'intérieur d'un cadre. J'ai enveloppé le cadre dans ma propre classe - TestFrame. Là, j'ai remplacé le OnElementPropertyChanged. L'exception se produit lorsque j'obtiens un événement de modification de propriété pour la propriété "Y". Gardez à l'esprit que, parfois, j'obtiens l'exception dans le LabelRenderer lui-même, plutôt que dans le Frame. Je suppose que le problème persiste, juste dans ce cas, il apparaît lorsque nous avons un cadre. Voici une trace de pile:

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Test.Droid.Renderers.TestFrameRenderer'.
  at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <42748fcc36b74733af2d9940a8f3cc8e>:0 
  at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <42748fcc36b74733af2d9940a8f3cc8e>:0 
  at Android.Views.View.get_Context () [0x0000a] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 
  at Test.Droid.Renderers.TestFrameRenderer.UpdateFrame (Test.Views.Controls.TestFrame frameElement) [0x00001] in ...Test.Android\Renderers\TestFrameRenderer.cs:50 
  at Test.Droid.Renderers.TestFrameRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x0001f] in ...\Test.Android\Renderers\TestFrameRenderer.cs:44 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:229 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:362 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:464 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:400 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x00042] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:335 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindablePropertyKey propertyKey, System.Object value) [0x0000e] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:319 
  at Xamarin.Forms.VisualElement.set_Y (System.Double value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:556 
  at Xamarin.Forms.VisualElement.set_Bounds (Xamarin.Forms.Rectangle value) [0x00050] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:408 
  at Xamarin.Forms.VisualElement.Layout (Xamarin.Forms.Rectangle bounds) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:779 
  at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion (Xamarin.Forms.VisualElement child, Xamarin.Forms.Rectangle region) [0x001da] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:157 
  at Xamarin.Forms.Grid.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x00144] in D:\a\1\s\Xamarin.Forms.Core\GridCalc.cs:49 
  at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x00158] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:239 
  at Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:203 
  at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:869 
  at Xamarin.Forms.Layout.ResolveLayoutChanges () [0x00069] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:374 
  at Xamarin.Forms.Platform.Android.Platform+DefaultRenderer.OnMeasure (System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x0000f] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:1319 
  at Android.Views.View.n_OnMeasure_II (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00008] in <7d2292394f8c488b97f5bc2a0ac0240d>:0 
  at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.36(intptr,intptr,int,int)

@mduchev Je réalise que le nom de l'exception est le même mais ce type d'exception est comme une NullReferenceException. Chacun est une cause différente. Celui que vous avez ne sera pas lié à celui-ci.

Si vous pouvez créer un nouveau problème avec une reproduction, cela serait utile

@mduchev Voyez -vous votre exception en 4.8?

@mduchev J'ai remarqué que votre exception venait d'un moteur de rendu personnalisé

Si vous utilisez simplement notre moteur de rendu, voyez-vous la même exception?

Vous devrez peut-être vérifier si votre FrameRenderer a été supprimé et ne pas appeler ce code

at Test.Droid.Renderers.TestFrameRenderer.UpdateFrame (Test.Views.Controls.TestFrame frameElement) [0x00001] in ...Test.Android\Renderers\TestFrameRenderer.cs:50 
  at Test.Droid.Renderers.TestFrameRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x0001f] in ...\Test.Android\Renderers\TestFrameRenderer.cs:44 

@PureWeen Cela peut être un autre problème,
Malheureusement, je ne peux pas télécharger de repro. Je vais essayer d'en créer un et de le tester avec le cadre enveloppant l'étiquette.
Je viens d'essayer avec 4.8.0.1560 et l'exception est là. Je l'ai également testé et confirmé avec 4.7.0.1351 et 5.0.0.1558-pre3.

@mduchev ou est-ce que quelqu'un sait pourquoi la version 5 de Xamarin sera publiée en disant que ce problème a été résolu mais se produit toujours? Je ne pouvais pas comprendre.

Même en utilisant cette ligne Forms.SetFlags (" UseLegacyRenderers ") dans le projet, une exception se produit avec ObjectName:
Xamarin.Forms.Platform.Android.AppCompat.FrameRenderer

Sans ligne à marquer, l'exception a ce ObjectName:
Xamarin.Forms.Platform.Android.FastRenderers.FrameRenderer

@TsplayerT Je pense que le problème que nous voyons tous les deux (l'exception FrameRenderer) est un problème distinct. Le problème principal - celui avec LabelRenderer peut en effet être corrigé, mais un bogue similaire se produit avec le FrameRenderer. J'ai également remarqué la nouvelle exception uniquement lorsque j'utilise quelque chose à l'intérieur d'un cadre. Malheureusement, je ne peux pas identifier la mise en page exacte et les étapes qui bloquent l'application. Si vous le pouvez, veuillez fournir un exemple de projet et ouvrir un nouveau problème pour l'exception de cadre.

@ZeProgFactory Merci pour la solution de contournement parfaite pour les personnes comme moi, qui ne peuvent pas mettre à jour vers la dernière version de Xamarin, en raison de nombreux problèmes, qui sont toujours en attente d'être ajoutés à un sprint spécifique, même ...

Cette page vous a été utile?
0 / 5 - 0 notes