question

ShaileyLalwani-0654 avatar image
0 Votes"
ShaileyLalwani-0654 asked ShaileyLalwani-0654 commented

Android.Views.WindowManagerBadTokenException at at AndroidHUD.AndHUD+<>c__DisplayClass29_0.<SetupDialog>b__0 (System.Object state) [0x000db] in <a4dd75a72c8244ad8bdba54b31441bb5>:0

Xamarin Forms application on Android device crashes with this error.

dotnet-xamarin
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ShaileyLalwani-0654 , could you please post the full error log about this problem?If it is convenient for you, could you please post some code snippets or a basic demo so that we can try to reproduce this problem on our side?

0 Votes 0 ·

1 Answer

ShaileyLalwani-0654 avatar image
0 Votes"
ShaileyLalwani-0654 answered ShaileyLalwani-0654 commented

Hi @JessieZhang-2116 , I can't share code snippet because of some security policy, above problem is been reported on client user device in Crash Analytical tool, so exactly don't have steps to reproduce. Below is the list of Nuget packages used in the application if that can help:
<PackageReference Include="Acr.UserDialogs" Version="7.1.0.470" />
<PackageReference Include="AiForms.Layouts" Version="1.1.0" />
<PackageReference Include="AWSSDK.S3" Version="3.3.18.2" />
<PackageReference Include="Bugsee.Xamarin" Version="1.10.5" />
<PackageReference Include="DLToolkit.Forms.Controls.FlowListView" Version="2.0.10" />
<PackageReference Include="modernhttpclient-updated" Version="3.3.4" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="PCLStorage" Version="1.0.2" />
<PackageReference Include="Rg.Plugins.Popup" Version="2.0.0.5" />
<PackageReference Include="SkiaSharp.Views.Forms" Version="1.68.0" />
<PackageReference Include="sqlite-net-pcl" Version="1.4.118" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.8.0" />
<PackageReference Include="Xam.Plugin.Media" Version="4.4.10-beta" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Xamarin.Forms" Version="4.5.0.617" />
<PackageReference Include="XLabs.IoC" Version="2.0.5782" />
<PackageReference Include="XLabs.Platform" Version="2.0.5782" />

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ShaileyLalwani-0654 , could you please post the full error log about this problem?

0 Votes 0 ·

android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@db81f9c is not valid; is your activity running?

According to the log, it is often due to that it want to display a view (e.g. dialog) on a special page, but now it couldn't find the page (on android ,it's activity).Then it will throw such error log. You can recheck your code.

0 Votes 0 ·

Hi @JessieZhang-2116 , yes correct! But can you please help me with the solution as to where to check whether is activity is available or not when using Acr.UserDialogs in Xamarin Forms application.

0 Votes 0 ·