我在Xamarin Android上遇到问题。
使用我的应用的多个Android用户在三星设备上收到ANR错误(9/10)。我试图在我们的设备上复制问题,但没有成功(三星S9和A3 2016)。
主页页面似乎可以正常工作;它使用do while语句,但我不认为是有影响力的(请参见下面的代码)。 在执行某些http请求时,在登录阶段会发生错误。
首页动画:
private async Task AnimazioneTiles()
{
try
{
do
{
foreach (VMTileWelcome tile in tilesWelcome)
{
tileImage.Source = tile.ImageSource;
tileTitle.Text = tile.Title;
tileSubTitile.Text = tile.SubTitle;
await stackContenitoreTiles.FadeTo(1, 400, Easing.Linear);
await Task.Delay(5000);
await stackContenitoreTiles.FadeTo(0, 400, Easing.Linear);
await Task.Delay(500);
}
}
while (true);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"Errore animazione! {ex}");
}
}
Http请求:
HttpOperationResponse<t> result = await Task.Run(async () => await this.PostAsync<t>(endPoint, content));
ANR Google控制台:
输入调度超时(等待发送非键事件,因为触摸的窗口尚未完成处理500.0ms之前传送给它的某些输入事件。等待队列长度:14.等待队列头年龄:61840.6ms。 )
md5b5fc6e3de8ade6adb016b96a6a1d3645.MainActivity
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 obj=0x773c4e18 self=0x773eccba00
| sysTid=11111 nice=-10 cgrp=default sched=0/0 handle=0x774361cab0
| state=S schedstat=( 40042176353 355926648 12143 ) utm=3900 stm=104 core=4 HZ=100
| stack=0x7fd48ce000-0x7fd48d0000 stackSize=8MB
| held mutexes=
#00 pc 000000000001bf6c /system/lib64/libc.so (syscall+28)
#01 pc 00000000000e8890 /system/lib64/libart.so (_ZN3art17ConditionVariable16WaitHoldingLocksEPNS_6ThreadE+160)
#02 pc 000000000034aa64 /system/lib64/libart.so (_ZN3art3JNI23CallStaticObjectMethodAEP7_JNIEnvP7_jclassP10_jmethodIDP6jvalue+292)
#03 pc 000000000000b4d0 /data/app/it.tisviluppo.fpcu-1/lib/arm64/libmonodroid.so (java_interop_jnienv_call_static_object_method_a+40)
at md58432a647068b097f9637064b8985a5e0.NavigationPageRenderer.n_onAttachedToWindow (Native method)
at md58432a647068b097f9637064b8985a5e0.NavigationPageRenderer.onAttachedToWindow (NavigationPageRenderer.java:49)
at android.view.View.dispatchAttachedToWindow (View.java:16879)
at android.view.ViewGroup.dispatchAttachedToWindow (ViewGroup.java:3129)
at android.view.ViewGroup.dispatchAttachedToWindow (ViewGroup.java:3136)
at android.view.ViewGroup.addViewInner (ViewGroup.java:4675)
at android.view.ViewGroup.addView (ViewGroup.java:4477)
at android.view.ViewGroup.addView (ViewGroup.java:4417)
at android.view.ViewGroup.addView (ViewGroup.java:4390)
at android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1425)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState (FragmentManager.java:1750)
at android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1819)
at android.support.v4.app.BackStackRecord.executeOps (BackStackRecord.java:797)
at android.support.v4.app.FragmentManagerImpl.executeOps (FragmentManager.java:2590)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether (FragmentManager.java:2377)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute (FragmentManager.java:2332)
at android.support.v4.app.FragmentManagerImpl.execPendingActions (FragmentManager.java:2239)
at android.support.v4.app.FragmentManagerImpl$1.run (FragmentManager.java:700)
at android.os.Handler.handleCallback (Handler.java:751)
at android.os.Handler.dispatchMessage (Handler.java:95)
at android.os.Looper.loop (Looper.java:154)
at android.app.ActivityThread.main (ActivityThread.java:6823)
at java.lang.reflect.Method.invoke! (Native method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1451)
有人对xamarin有相同的问题吗?
答案 0 :(得分:0)
问题在于三星设备的节能模式!