Xamarin.forms: System.ObjectDisposedException:破棄されたオブジェクトにアクセスできません 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'

作成日 2020年05月20日  ·  73コメント  ·  ソース: xamarin/Xamarin.Forms

_この問題は、開発者コミュニティのチケットから移動されまし


Xamarin Forms 4.6.0726にアップグレードした後、Androidで頻繁に断続的にクラッシュし始めました。 調査の結果、これはXamarinのLabelRendererからのものであることが判明しました

05-17 07:27:06.656 E /モノ(5133):
05-17 07:27:06.656 E / mono(5133):未処理の例外:
05-17 07:27:06.656 E / mono(5133):System.ObjectDisposedException:破棄されたオブジェクトにアクセスできません。
05-17 07:27:06.656 E / mono(5133):オブジェクト名: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'。
05-17 07:27:06.656 E / mono(5133):at(wrapper dynamic-method)Android.Runtime.DynamicMethodNameCounter.29(intptr、intptr)
05-17 07:27:06.656 E / mono(5133):at(ラッパーネイティブからマネージド)Android.Runtime.DynamicMethodNameCounter.29(intptr、intptr)
05-17 07:27:06.656 E / mono-rt(5133):[エラー]致命的な未処理の例外:System.ObjectDisposedException:破棄されたオブジェクトにアクセスできません。
05-17 07:27:06.656 E / mono-rt(5133):オブジェクト名: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'。
05-17 07:27:06.656 E / mono-rt(5133):at(ラッパー動的メソッド)Android.Runtime.DynamicMethodNameCounter.29(intptr、intptr)
05-17 07:27:06.656 E / mono-rt(5133):at(ラッパーネイティブからマネージド)Android.Runtime.DynamicMethodNameCounter.29(intptr、intptr)
05-17 07:27:06.698 D /(5133):HostConnection :: get()新しいホスト接続が確立されました0xbd1b1240、tid 5133

それがどこから来ているのかわからない。 ListViewをメインビューとして使用していますが、新しいバージョンのListViewに問題があり、リークやクラッシュが発生しているのではないかと考えています。

カスタムラベルレンダラーがないため、Xamarinのプラットフォームレンダラーから取得する必要があります
提案してください。


元のコメント

2020年5月17日午後11時54分のVisualStudioフィードバックシステム:

さらなる評価のために、フィードバックを適切なエンジニアリングチームに転送しました。 チームはフィードバックを確認し、次のステップについて通知します。


オリジナルソリューション

(解決策なし)

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

最も参考になるコメント

マイクロソフトがこのプラットフォームを使用して、このような基本的な欠陥を備えたエンタープライズアプリを作成することをどのように期待できるかは、このような長期間にわたる非常に多くの苦情の後でまだ開かれていることはまったくばかげています!

過去4か月間、Androidバージョンのアプリのアップデートをリリースできませんでした。このスレッドから得られるのは、他の世界では簡単に再現できるのに、これを再現できないということだけです。

このバグを修正する前に、Microsoftは何もすることをやめるべきです。 Xamarinの新しいバージョンをリリースしても、ほとんど意味がありません!!!

全てのコメント73件

関連#8262

回避策-https //github.com/xamarin/Xamarin.Forms/issues/8262#issuecomment -550022425

ListViewまたはそのセルのカスタムレンダラーを構築することは、スクロールパフォーマンスに対するレイアウト計算の影響を減らすための1つのアプローチです。
ListViewのベストプラクティス-https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/listview/performance

ListViewを含むクラスにINotifyPropertyChanged (System.ComponentModel)を実装してみてください。
変更されたプロパティのsetアクセサーに対して、次のようにpublic event PropertyChangedEventHandler PropertyChangedのハンドラーを設定します-

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

関連#10159

この問題を示す小さなプロジェクトを添付していただけますか? ありがとう!

私も私のアプリをクラッシュさせる同じ問題に直面しています

スタックトレース:

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)

XFをバージョン4.4.0.991864にダウングレードすると、本番アプリの問題が解決しました。 クレジット: https

この問題を示す小さなプロジェクトを添付していただけますか? ありがとう!

@samhoutsソースコードを公開できません。これは商用アプリケーションです...そしてデータでしか機能しません。

この問題を示す小さなプロジェクトを添付していただけますか? ありがとう!

@samhouts残念ながら、契約上の理由によりコードを公開できません

こんにちは、修正が利用可能になるまでにタイムラインがあるかどうかを確認するだけです。 Xamarinフレームワークをアップグレードした後、この問題のためにメジャーリリースがリリースされ、現在保留になっています。 現時点では、古いフレームワークに戻ることもできません。

助けてください。

これらの問題は、複製せずに解決することは非常に困難です。 従来のレンダラーを有効にすることで、この問題を回避できる場合があり

これらの問題は、複製せずに解決することは非常に困難です。 従来のレンダラーを有効にすることで、この問題を回避できる場合があり

私はテストプロジェクトで再現しようとしています。

これらの問題は、複製せずに解決することは非常に困難です。 従来のレンダラーを有効にすることで、この問題を回避できる場合があります。 複製プロジェクトを投稿できれば、問題を完全に解決できる可能性があります。 ありがとうございました!

@samhouts 、提供された手順に従ってレガシーレンダラーを有効にしてみましたが、驚くべきことにエラーが引き続き発生します。

ソリューションをクリーンアップしてVSを閉じたり開いたりしようとしましたが、エラーが解決しません。

提案してください。 この点でどんな助けでも非常に役に立ちます!

こんにちは、

フォローアップして、まだ更新があるかどうか、またはいつ更新を期待するかを確認しようとしていますか?

私たちも問題を経験しています、再現するのは本当に難しいです、アプリはランダムにクラッシュします、
この問題は、Xamarinフォーム4.4から4.6.0726にアップグレードした後に発生し始めました。

複製を取得できるようになるまで、これをブロックされたリソースに移動する必要があります。

@samhoutsこれは非常に深刻な問題である#10159と非常によく似ています。 ご覧いただけますか? 再現サンプルを提供するコメントがあります。

この例外を確認できるサンプルリポジトリを作成しました: https

エラーを再現する方法を示すビデオも投稿しました。
https://www.youtube.com/watch?v=yDhlI4BG8D8&feature=youtu.be

説明

CollectionView内のLabelのFontSizeプロパティにバインディングを追加し、デバイスで回転を行うと(回転を変更するたびに、CollectionViewのLabelsのFontSizeを更新します)。

System.ObjectDisposedException: '破棄されたオブジェクトにアクセスできません。
オブジェクト名: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'。 '

再現する手順

デバイスで回転しながら、CollectionViewのソースに要素を追加します。

基本情報

  • 私はAppleデバイスを持っていないので、Androidでのみ試しました。
  • Xamarin.Forms 4.7.0.1239
  • Android 10

@samhouts Xamarin.Formsリポジトリを使用してマシンでいくつかのテストを行った後、エラーのトレースを追跡しました。これは、Platform.csクラスの次の行で正確に発生します//github.com/xamarin/Xamarin.Forms /blob/29b92aa1fc2b9d834bb3b95cc224e07d0cc3e9b4/Xamarin.Forms.Platform.Android/Platform.cs#L1341

StackTraceを取得するためにメソッドをtrycatchでラップしましたが、これが結果です。
Java.Interop.JniPeerMembers.AssertSelf(Java.Interop.IJavaPeerable self)[0x00029]で:0
Java.Interop.JniPeerMembers + JniInstanceMethods.InvokeNonvirtualObjectMethod(System.String encodingMember、Java.Interop.IJavaPeerable self、Java.Interop.JniArgumentValue *パラメーター)[0x00000]で:0
/Users/builder/azdo/_work/204/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-29/mcw/AndroidのAndroid.Views.View.get_Context()[0x00000] .Views.View.cs:5598
Xamarin.Forms.Platform.Android.Platform.GetNativeSize(Xamarin.Forms.VisualElementビュー、System.Double widthConstraint、System.Double heightConstraint)[0x0001c]のC:Users \ SourceReposXamarin.FormsXamarin.Forms.Platform.AndroidPlatform.cs: 1343

誰もがこれに対する解決策を持っていますか?

私のプロジェクトでも同じエラーに直面しています。 Xamarin.Forms4.6.0.726バージョンがあります。
スタックトレース:

  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)

アプリケーション出力ウィンドウには、次の出力が表示されます。

[モノ]未処理の例外:
[mono] System.ObjectDisposedException:破棄されたオブジェクトにアクセスできません。
[モノ]オブジェクト名: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'。
[mono] at(wrapper dynamic-method)Android.Runtime.DynamicMethodNameCounter.1(intptr、intptr)
[mono] at(ラッパーネイティブからマネージド)Android.Runtime.DynamicMethodNameCounter.1(intptr、intptr)
[mono-rt] [エラー]致命的な未処理の例外:System.ObjectDisposedException:破棄されたオブジェクトにアクセスできません。
[mono-rt]オブジェクト名: 'Xamarin.Forms.Platform.Android.FastRenderers.LabelRenderer'。
[mono-rt] at(wrapper dynamic-method)Android.Runtime.DynamicMethodNameCounter.1(intptr、intptr)

私はこれを私たちのリポジトリで再現することができます、私は次のようなことを試しました:

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

しかし、それは同じ問題では機能しません。

CollectionViewを含むページからCollectionViewを含む別のページに戻ると、4.7.0.1179で同様のことが発生します。

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)

この@samhoutsに関するいくつかの調査結果:
CollectionViewでもこの動作が見られました。 しばらく時間をかけてみたところ、以下のようなことが原因のようです。

注:これは理論です。

  1. OnViewRecycledは、TemplatedItemViewHolderを使用してItemsViewAdapterで呼び出されます。
  2. TemplatedItemViewHolder.Recycleが呼び出されると、TemplatedItemViewHolderに関連付けられているXamarin.Forms.ViewがItemsViewから削除されます。
  3. TemplatedItemViewHolderがRecyclerView.RecycledViewPoolにプッシュされます。
  4. その間に、何かがビュー/その子を処分します。
  5. ViewHolderが再バインドされて表示され、破棄されたビューでレイアウトトリガーが発生し、アプリがクラッシュします。

ItemsViewAdapter.OnViewRecycledをオーバーライドし、TemplatedItemViewHolderに戻ることで、これを回避しました。 次に、baseを呼び出す前に、OnBindViewHolderのItemsViewからTemplatedItemViewHolder.Viewを削除するコードを追加しました。

これまでのところ、問題を再現できなくなった人は誰もいません。

@joshuangfraedomアダプター変更のサンプルコードを共有できますか?

このようなもの@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);
            }
        }
}

SelectableItemsViewAdapter読み取ると、上記のようにメモリリークが発生するようです。 適切なソリューションを得るには、これをフォームレベルで解決する必要があります(すべてがそのクラスに内部化されています)。

これはもう少し堅牢で、以前の@ DuncWatts

ただし、ItemsViewに参照を保持すると、参照が十分にクリーンアップされないように見えます。

    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);
                }
            }
        }
    }

これに対するより良い解決策は、 TemplatedItemViewHolder.Recycleのビューをクリアしてから、 templateChangingブランチのすべてを再度実行することです。 これはより安全なアプローチのように思えますが、XFコードベースで変更が行われない場合は、多数のものを再実装する必要があります。 ビューとそのレンダラーがリサイクルとバインドの間で保持されることを信頼することは信頼できるとは思いません。

これを再現することはできませんが、アプリの原因は、破棄中の(ビジュアルツリーから削除された)UIへのバインディングの起動でした。
幸いなことに、問題を解決するには、バインディングモードをOneTimeに設定するだけで済みました。

Xamarin.Forms4.6.0.847で同じクラッシュの問題が発生しています。
SyncfusionのSfComboBox(v18.2.0.44)を数回いじると、このクラッシュスタックトレースが表示されます。 その中のラベルがクラッシュすると思います。

@ Edgaras91私の経験では、syncfusionSfComboBoxも使用していました。 ItemTemplateの要素は、IsVisibleをビューモデル(IsSelected)のプロパティにバインドしていました。
コンボボックスのドロップダウンを閉じる新しい選択が行われたとき、バインドされたItemSourceモデルのIsSelectedプロパティをリセットすると、クラッシュが発生していました。
バインディングモードをOneTimeに変更すると、問題が解決しました。

@ Edgaras91私の経験では、syncfusionSfComboBoxも使用していました。 ItemTemplateの要素は、IsVisibleをビューモデル(IsSelected)のプロパティにバインドしていました。
コンボボックスのドロップダウンを閉じる新しい選択が行われたとき、バインドされたItemSourceモデルのIsSelectedプロパティをリセットすると、クラッシュが発生していました。
バインディングモードをOneTimeに変更すると、問題が解決しました。

@InquisitorJaxに感謝しますが、DataSourceバインディングモデルをOneTimeに変更しても、クラッシュの問題は解決しませんでした。

他の人を助けるかもしれないこのクラッシュを再現する方法に関するいくつかのより多くの情報:

SfComboBoxとそのデータソース内のデータを含むビューでは、すべてが安定しています。
次に、 Rg.Plugins.Popupを使用して「ポップアップ」を開き、BindingContextと同じViewModelを再利用し、3秒間開いたままにしてこのポップアップを閉じ、ドロップダウンから選択して元のSfComboBoxの値を2回変更すると、がスローされます。 LabelRenderer例外。

Syncfusionにまだ投稿していない理由は、例外が純粋なXamarinフォームであるためです。 提案されたXamarinバージョンのロールバック回避策はまだ試していません。

私にとってXF4.4.0.991864はそれを修正せず、それでも同じ例外が発生することを確認できます。

Xamarinフォーム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)

この問題は、アイテムテンプレートを使用したコレクションビューで再現できます。 これは私たちにとって重大なバグになっています。

コレクションビューのテンプレートセレクターがあり、テンプレートは拡張可能なコンポーネントで構成されており、拡張可能なアイコンをクリックすると、以下の例外を除いてアプリがクラッシュします。

注:拡張機能は、visible falseを設定し、親グリッドの行サイズをAutoに設定するだけで実現できます。

LabelRendererだけでなく、展開可能なビューにラベルがない場合は、ImageRenderer例外も発生します。

`09-10 20:20:28.104 E / AppCenterCrashes(23119):source = AndroidEnvironmentからの未処理の例外
09-10 20:20:28.104 E / AppCenterCrashes(23119):System.ObjectDisposedException:破棄されたオブジェクトにアクセスできません。
09-10 20:20:28.104 E / AppCenterCrashes(23119):オブジェクト名: 'Xamarin.Forms.Platform.Android.FastRenderers.ImageRenderer'。
09-10 20:20:28.104 E / AppCenterCrashes(23119):Java.Interop.JniPeerMembers.AssertSelf(Java.Interop.IJavaPeerable self)[0x00029]で:0
09-10 20:20:28.104 E / AppCenterCrashes(23119):Java.Interop.JniPeerMembers + JniInstanceMethods.InvokeNonvirtualObjectMethod(System.String encodingMember、Java.Interop.IJavaPeerable self、Java.Interop.JniArgumentValue *パラメーター)[0x00000]:0
09-10 20:20:28.104 E / AppCenterCrashes(23119):Android.Views.View.get_Context()[0x0000a]で<55654ebe9f2a48e6bade2862bb243f94>:0
09-10 20:20:28.104 E / AppCenterCrashes(23119):Xamarin.Forms.Platform.Android.Platform.GetNativeSize(Xamarin.Forms.VisualElementビュー、System.Double widthConstraint、System.Double heightConstraint)[0x00019] in D :a1sXamarin.Forms.Platform.AndroidPlatform.cs:1341
09-10 20:20:28.104 E / AppCenterCrashes(23119):Xamarin.Forms.Forms + AndroidPlatformServices.GetNativeSize(Xamarin.Forms.VisualElementビュー、System.Double widthConstraint、System.Double heightConstraint)[0x00000] in D:a1sXamarin .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] in 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] in 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] in 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] in 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フラグ)[0x00054] in 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] in 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] in 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] in D: a1sXamarin.Forms.CoreGridCalc.cs:18
09-10 20:20:28.104 E / AppCenterCrashes(23119):D:a1sXamarin.Forms.CoreLayout.cs:266のXamarin.Forms.Layout.UpdateChildrenLayout()[0x00158]で
09-10 20:20:28.104 E / AppCenterCrashes(23119):Xamarin.Forms.Layout.OnSizeAllocated(System.Double width、System.Double height)[0x0000f] in 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] in D:a1sXamarin.Forms.CoreVisualElement.cs:859
09-10 20:20:28.104 E / AppCenterCrashes(23119):D:a1sXamarin.Forms.CoreLayout.cs:392のXamarin.Forms.Layout.ResolveLayoutChanges()[0x0005c]で
09-10 20:20:28.104 E / AppCenterCrashes(23119):Java.Lang.Thread + RunnableImplementor.Run()[0x00008]で<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(wrapper dynamic-method)Android.Runtime.DynamicMethodNameCounter.1(intptr、intptr)

System.ObjectDisposedException: '
オブジェクト名: 'Xamarin.Forms.Platform.Android.FastRenderers.ImageRenderer'。 '`

マイクロソフトがこのプラットフォームを使用して、このような基本的な欠陥を備えたエンタープライズアプリを作成することをどのように期待できるかは、このような長期間にわたる非常に多くの苦情の後でまだ開かれていることはまったくばかげています!

過去4か月間、Androidバージョンのアプリのアップデートをリリースできませんでした。このスレッドから得られるのは、他の世界では簡単に再現できるのに、これを再現できないということだけです。

このバグを修正する前に、Microsoftは何もすることをやめるべきです。 Xamarinの新しいバージョンをリリースしても、ほとんど意味がありません!!!

この例外に対する私の回避策(バージョン変更が機能しないことを確認するために、4.5.Xから4.8.XまでのXFバージョンをテストする):
POV: CarouselView(モーダルとして)は、番号付きのラベルを保持しています(カート内の製品数量を選択します)。 このコントロールは、ユーザーが数量を変更したい場合にのみ表示されます。 この例外は、カルーセルビューが非表示になっているときに発生していましたが、それでもバインディングList <>およびSelectedItemに「接続」されていました。
解決策: Clickedイベントが発生した直後に、このコントロールをxaml.csに入力します。 このように、このコントロールはViewModel / PageModelクラスに接続されていません。
このソリューションは、バインディングのシミュレーションです。
`` `c#
// _ countsはCarouselViewです
private void QuantumChangeTapped(object sender、System.EventArgs e)//ボタンのイベント
{{
CartItem item =(Sender as View).BindingContext as CartItem; //数量が変更されるカート内の商品
_viewModel.Item = item; //すでに保存されている数量を設定します
_counts.ItemsSource = Enumerable.Range(1、item.QuantityRemaining).ToList();
_counts.Position = item.Quantity-1; //カルーセルをスクロールしてすでに保存されている数量
ShowSlider(); //カルーセルを表示
}
private void CountApprouveClicked(object sender、System.EventArgs e)//「選択した数量を保存」というボタンのイベント
{{
CloseSlider();
_viewModel.SelectedCount =(int)_counts.CurrentItem;
_viewModel.OnCountApprouve.Execute(null);
}

`` `

これに再び遭遇しました-Syncfusionコントロールが含まれていなかっただけです。
ViewModelへのIsVisibleバインディングを持つDataTemplate上のアイテム。
ただし、解決策は同じです。BindingModeをOneTimeに設定します。

この問題を見ている人は、ここのnugetでテストできますか?

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

それでも例外が表示される場合はお知らせください。

この問題を見ている人は、ここのnugetでテストできますか?

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

それでも例外が表示される場合はお知らせください。

投稿したナゲットを試しましたが、例外が発生し続けます。前の例外との唯一の違いは、Xamarin.Forms.Platform.Android.FastRenderers.LabelRendererを参照する代わりに、例外がXamarin.Forms.Platform.Androidを参照することです。 Platform + DefaultRenderer

新しい例外:

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

古い例外:

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

@nacomplloスタックトレース全体を投稿できますか? 異なるのはおそらく1行だけだと思いますが、ここに完全なトレースがあると便利です。

@PureWeen nugetをテストしましたが、それでもクラッシュしますが、スタックが少し異なります

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
出力ウィンドウから取得したすべての情報を添付します。

09-13 12:37:30.755 I / MonoDroid(21323):未処理の例外:
09-13 12:37:30.758 I / MonoDroid(21323):System.ObjectDisposedException:破棄されたオブジェクトにアクセスできません。
09-13 12:37:30.759 I / MonoDroid(21323):オブジェクト名: 'Xamarin.Forms.Platform.Android.Platform + DefaultRenderer'。
09-13 12:37:30.759 I / MonoDroid(21323):at(ラッパー動的メソッド)Android.Runtime.DynamicMethodNameCounter.33(intptr、intptr、bool、int、int、int、int)
09-13 12:37:30.759 I / MonoDroid(21323):at(ラッパーネイティブからマネージド)Android.Runtime.DynamicMethodNameCounter.33(intptr、intptr、int、int、int、int、int)
09-13 12:37:30.759 I / MonoDroid(21323):at(ラッパー管理からネイティブ)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(Java.Interop.JniObjectReferenceインスタンス、Java.Interop.JniObjectReferenceタイプ、Java.Interop.JniMethodInfoメソッド、Java.Interop .JniArgumentValue * args)[0x00079] in <42748fcc36b74733af2d9940a8f3cc8e>:0
09-13 12:37:30.759 I / MonoDroid(21323):Java.Interop.JniPeerMembers + JniInstanceMethods.InvokeVirtualVoidMethod(System.String encodingMember、Java.Interop.IJavaPeerable self、Java.Interop.JniArgumentValue *パラメーター)[0x0005d] <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] in 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]の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] in 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変更、System.Int32 l、 System.Int32 t、System.Int32 r、System.Int32 b)[0x0002f] in D:agent1sXamarin.Forms.Platform.AndroidAppCompatPlatform.cs:235
09-13 12:37:30.759 I / MonoDroid(21323):Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout(System.Booleanが変更されました、System.Int32 l、System.Int32 t、System.Int32 r、System。 Int32 b)D:agent1sXamarin.Forms.Platform.AndroidPlatformRenderer.cs:75の[0x0001d]
09-13 12:37:30.759 I / MonoDroid(21323):Android.Views.ViewGroup.n_OnLayout_ZIIII(System.IntPtr jnienv、System.IntPtr native__this、System.Booleanchanged、System.Int32 l、System.Int32 t、System .Int32 r、System.Int32 b)[0x00008] in <7d2292394f8c488b97f5bc2a0ac0240d>:0
09-13 12:37:30.759 I / MonoDroid(21323):at(ラッパー動的メソッド)Android.Runtime.DynamicMethodNameCounter.27(intptr、intptr、bool、int、int、int、int)
System.ObjectDisposedException: '
オブジェクト名: 'Xamarin.Forms.Platform.Android.Platform + DefaultRenderer'。 '

09-13 12:37:33.822 E /モノ(21323):
09-13 12:37:33.822 E / mono(21323):未処理の例外:
09-13 12:37:33.822 E / mono(21323):System.ObjectDisposedException:破棄されたオブジェクトにアクセスできません。
09-13 12:37:33.822 E / mono(21323):オブジェクト名: 'Xamarin.Forms.Platform.Android.Platform + DefaultRenderer'。
09-13 12:37:33.822 E / mono(21323):at(wrapper dynamic-method)Android.Runtime.DynamicMethodNameCounter.33(intptr、intptr、bool、int、int、int、int)
09-13 12:37:33.822 E / mono(21323):at(ラッパーネイティブからマネージド)Android.Runtime.DynamicMethodNameCounter.33(intptr、intptr、int、int、int、int、int)
09-13 12:37:33.822 E / mono(21323):at(ラッパー管理からネイティブ)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):Java.Interop.JniEnvironment + InstanceMethods.CallNonvirtualVoidMethod(Java.Interop.JniObjectReferenceインスタンス、Java.Interop.JniObjectReferenceタイプ、Java.Interop.JniMethodInfoメソッド、Java.Interop .JniArgumentValue * args)[0x00079] in <42748fcc36b74733af2d9940a8f3cc8e>:0
09-13 12:37:33.822 E / mono(21323):Java.Interop.JniPeerMembers + JniInstanceMethods.InvokeVirtualVoidMethod(System.String encodingMember、Java.Interop.IJavaPeerable self、Java.Interop.JniArgumentValue *パラメーター)[0x0005d] <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] in 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] in 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] in 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が変更され、System.Int32 l、System.Int32 t、System.Int32 r、System.Int32 b)[0x0002f] in 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が変更されました、System.Int32 l、System.Int32 t、System.Int32 r、 System.Int32 b)[0x0001d] in D:agent1sXamarin.Forms.Platform.AndroidPlatformRenderer.cs:75
09-13 12:37:33.826 E / mono-rt(21323):Android.Views.ViewGroup.n_OnLayout_ZIIIIで(System.IntPtr jnienv、System.IntPtr native__this、System.Booleanが変更されました、System.Int32 l、System.Int32 t 、System.Int32 r、System.Int32 b)[0x00008] in <7d2292394f8c488b97f5bc2a0ac0240d>:0
09-13 12:37:33.826 E / mono-rt(21323):at(ラッパー動的メソッド)Android.Runtime.DynamicMethodNameCounter.27(intptr、intptr、bool、int、int、int、int)
09-13 12:37:33.826 E / mono-rt(21323):---例外がスローされた前の場所からのスタックトレースの終わり---
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(System.String value)[0x00024] in <42748fcc36b74733af2d9940a8f3cc8e>:0
09-13 12:37:33.826 E / mono-rt(21323):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(System.Stringメッセージ)[0x0001f] in <7d2292394f8c488b97f5bc2a0ac0240d>:0
09-13 12:37:33.826 E / mono-rt(21323):Android.Runtime.JavaProxyThrowable..ctor(System.Exception innerException)[0x00007] in <7d2292394f8c488b97f5bc2a0ac0240d>:0
09-13 12:37:33.826 E / mono-rt(21323):Java.Lang.Throwable.FromException(System.Exception e)[0x0001d]で<7d2292394f8c488b97f5bc2a0ac0240d>:0
09-13 12:37:33.826 E / mono-rt(21323):Android.Runtime.AndroidEnvironment.UnhandledException(System.Exception e)[0x00067]で<7d2292394f8c488b97f5bc2a0ac0240d>:0
09-13 12:37:33.826 E / mono-rt(21323):at(ラッパー動的メソッド)Android.Runtime.DynamicMethodNameCounter.27(intptr、intptr、bool、int、int、int、int)終了

09-13 12:37:33.826 E / mono-rt(21323):at(ラッパーネイティブからマネージド)Android.Runtime.DynamicMethodNameCounter.27(intptr、intptr、int、int、int、int、int)
09-13 12:37:33.865 E / libc ++ abi(21323):終了
09-13 12:37:33.866 F / libc(21323):致命的なシグナル6(SIGABRT)、tid 21323(ame.labelrender)、pid 21323(ame.labelrender)のコード-1(SI_QUEUE)

@nacompllo @Reveon

これを試して、私に知らせてください!

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

@nacompllo @Reveon

これを試して、私に知らせてください!

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

@PureWeen
新しいナゲットでテストを行ったところ、問題は解決されたようですが、再現されなくなったようです。このナゲットはこの問題を解決しているようです。 よくできました。

@PureWeen簡単なテストを行いましたが、例外がなくなったようです

@PureWeenまた、現時点では、クイックテストの後でアプリがこの例外を発生させないことを確認します。

驚くばかり!!

@PureWeen 、提供された

この「nuget」をXamarinFormsにインストールする方法を誰かが説明できますか?

@ Edgaras91これを見てください

@ Edgaras91
リンクをクリックしてください。
「nuget」パネルの右側に「詳細」ボタン(縦に3つ並んだ点)があり、コンテキストメニューから「ダウンロード[...]」を選択します。
次に、( @ Reveonが述べたように)システムファイル(「C:reposlocalNugets」など)にローカルnugetのローカルソースを設定し、ダウンロードしたzipのzipコンテンツをこのフォルダーに配置します(Xamarin .nupkgファイルがいくつかあります)。
次に、VSでNuGetマネージャーを開き、このコンボボックスから
obraz
ローカルソースを選択します(私のものは単に「ローカル」と呼ばれます)
最後に、通常どおり、選択したプロジェクトにXamarin.Formsをインストール/更新します。

@Reveon@BartoszKopecに感謝します。 ただし、Dev Opsの継続的インテグレーションもあります。これは楽しいでしょう。これが承認された修正であり、できるだけ早く展開されることを願っています。

@ Edgaras91私はCIとして

これが解決されるように見えることも確認できます。
@PureWeenこれが予定されているリリースのイータが多かれ少なかれ何であるかを知っていますか?

  • ところで原因を釘付けにする素晴らしい仕事;)

こんにちは、
この問題を抱えている人のために:私の場合、 IsVisible介して可視性を変更するいくつかのラベルがありました。
BackGroundColorに変更し、 TextColorColor.Transparentかどうかにかかわらず、問題は解消されました…
お役に立てれば ...

この修正は次の4.8に含まれますか? それとも5.0だけですか?

4.8の次のSR

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

そのリリースには含まれていません。Xamarinフォーム4.8サービスリリース3を待つ必要があります。

そのリリースには含まれていません。Xamarinフォーム4.8サービスリリース3を待つ必要があります。

@joshuangfraedomこの問題は、Xamarinフォーム4.8サービスリリース3で修正されているということですか?

いつ公開される予定ですか? どのぐらい待つのか ... :-)))

申し訳ありませんが、これを試してみたい場合は、現在XF5.0プレリリース1で修正されているようです。 @samhoutsは、4.8の別のサービスリリースのアップデートを入手できますか?

同じエラーXamarin5.0.0.1539-pre2でプロジェクトをテストしましたが、それでも解決しません

System.ObjectDisposedException: Cannot access a dropped object

プロジェクトでこの行Forms.SetFlags ("UseLegacyRenderers")を使用すると、例外にはObjectNameがあります。
Xamarin.Forms.Platform.Android.AppCompat.FrameRenderer

フラグ行がない場合、ObjectName:
Xamarin.Forms.Platform.Android.FastRenderers.FrameRenderer

@TsplayerT完全なスタックトレースを投稿できますか?

ここにあります:

| メインスレッド| 詳細|
| ------------------- | ------------------- |
| Java.Interop | JniPeerMembers.AssertSelf(Java.Interop.IJavaPeerable self)|
| Java.Interop | JniPeerMembers + JniInstanceMethods.InvokeVirtualVoidMethod(System.String encodingMember、Java.Interop.IJavaPeerable self、Java.Interop.JniArgumentValue *パラメーター)|
| Android.Views | View.set_Enabled(System.Boolean値)|
| Xamarin.Forms.Platform.Android.FastRenderers | VisualElementRenderer.UpdateIsEnabled()|
| Xamarin.Forms.Platform.Android.FastRenderers | VisualElementRenderer.OnElementPropertyChanged(System.Object sender、System.ComponentModel.PropertyChangedEventArgs e)(ラッパーデリゲート-呼び出します.invoke_void_object_PropertyChangedEventArgs(object、System.ComponentModel.PropertyChangedEventArgs)|
| Xamarin.Forms | BindableObject.OnPropertyChanged(System.String propertyName)|
| Xamarin.Forms | Element.OnPropertyChanged(System.String propertyName)|
| Xamarin.Forms | BindableObject.SetValueActual(Xamarin.Forms.BindablePropertyプロパティ、Xamarin.Forms.BindableObject + BindablePropertyContextコンテキスト、System.Object値、System.Boolean currentApplying、Xamarin.Forms.Internals.SetValueFlags属性、System.Booleanサイレント)|
| Xamarin.Forms | BindableObject.SetValueCore(Xamarin.Forms.BindablePropertyプロパティ、System.Object値、Xamarin.Forms.Internals.SetValueFlags属性、Xamarin.Forms.BindableObject + SetValuePrivateFlags privateAttributes)|
| Xamarin.Forms | BindingExpression.ApplyCore(System.Object sourceObject、Xamarin.Forms.BindableObjectターゲット、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)(ラッパー動的メソッド)Android.Runtime.DynamicMethodNameCounter.24(intptr、intptr)|

エラーの詳細やその他の情報が添付されています。 report.txt

これを再開する必要があります。 5.0.0.1558-pre3でも再現できます。
次の場合があることに注意してください-フレーム内にいくつかの要素(ラベルを含む)があります。 フレームを自分のクラスであるTestFrameでラップしました。 そこで、OnElementPropertyChangedをオーバーライドしました。 「Y」プロパティのプロパティ変更イベントを取得すると、例外が発生します。 フレームではなく、LabelRenderer自体で例外が発生する場合があることに注意してください。 問題はまだ残っていると思いますが、この場合はフレームがあるときに発生します。 スタックトレースは次のとおりです。

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例外名は同じですが、このタイプの例外はNullReferenceExceptionのようなものです。 それぞれが異なる原因です。 あなたが持っているものはこれとは関係ありません。

あなたが役に立つだろう再現で新しい問題を作成することができれば

@mduchev 4.8で例外が発生していますか?

@mduchevあなたの例外がカスタムレンダラーから来ていることに気づきました

レンダラーを使用するだけの場合、同じ例外が発生しますか?

FrameRendererが破棄されているかどうかを確認し、このコードを呼び出さないようにする必要がある場合があります

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それは別の問題かもしれません、確かに言うことはできません。 ObjectDisposedExceptionが表示されますが、前述のように、例外はFastRenderers.LabelRendererのObjectDisposedExceptionです(同じフローの場合)。
残念ながら、再現をアップロードすることはできません。 作成して、ラベルをラップするフレームでテストしてみます。
4.8.0.1560で試しましたが、例外があります。 また、4.7.0.1351および5.0.0.1558-pre3でテストおよび確認しました。

@mduchevまたは、この問題が修正されたがまだ発生していると言ってXamarinのバージョン5がリリースされる理由を誰かが知っていますか? 私は理解出来なかった。

プロジェクトでこの行Forms.SetFlags (" UseLegacyRenderers ")を使用しても、ObjectNameで例外が発生します。
Xamarin.Forms.Platform.Android.AppCompat.FrameRenderer

フラグを立てる行がない場合、例外には次のObjectNameがあります。
Xamarin.Forms.Platform.Android.FastRenderers.FrameRenderer

@TsplayerT両方で発生している問題(FrameRenderer例外)は別の問題だと思います。 主な問題-LabelRendererの問題は実際に修正される可能性がありますが、FrameRendererでも同様のバグが発生しています。 また、フレーム内で何かを使用している場合にのみ、新しい例外に気づきました。 残念ながら、アプリをクラッシュさせる正確なレイアウトと手順を正確に特定することはできません。 可能であれば、サンプルプロジェクトを提供し、フレーム例外の新しい問題を開いてください。

@ZeProgFactory特定のスプリントに追加されるまでまだ保留中の多くの問題のために、最新のXamarinバージョンに更新できない私のような人々のための完璧な回避策をありがとう...

このページは役に立ちましたか?
0 / 5 - 0 評価