我刚刚在商店上启动了一个应用程序,然后通过检查错误报告来了解我从MSDN提取的通用代码片段在Lumia 520设备上崩溃了。我可以阻止52x所有者下载此应用程序吗?
[编辑]
这是代码:
// Use the back sensor as the default sensor
CameraSensorLocation defaultSensor = CameraSensorLocation.Back;
// If the user already configured the front sensor, use it (true=front, false=back)
if ((bool)appSettings["sensor"]) { defaultSensor = CameraSensorLocation.Front; frontMode.Visibility = System.Windows.Visibility.Visible; }
// Let's check which sensors exist
var availableLocations = PhotoCaptureDevice.AvailableSensorLocations;
// There comes the bug
var captureRes = PhotoCaptureDevice.GetAvailableCaptureResolutions(defaultSensor);
这是异常(不包含内部异常):
异常消息:
The request is not supported. (Exception from HRESULT: 0x80070032)
堆栈跟踪:
at Windows.Phone.Media.Capture.PhotoCaptureDevice.GetAvailableCaptureResolutions (CameraSensorLocation sensor)
at Vixl.Pages.ShootPage.<openCamera>d__c.MoveNext() --- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__0(Object state)
GetAvailableCaptureResolutions
作为异步方法,相关部分只是堆栈顶部的第一级异常消息。传感器是后部传感器,而不是前部传感器。我将针对此特定错误进行调查。
Lumia 520是512 MB的设备,因此您的应用由于内存问题而崩溃的可能性要比Lumia 520特定。
据我所知,关于谁可以下载应用程序的唯一控制权就是您可以在应用程序清单中为应用程序定义的要求,它们都处理诸如NFC,前置/后置摄像头等内容。
引发哪种异常导致应用程序崩溃?您可以发布堆栈跟踪和相关代码吗?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句