Click here to Skip to main content
15,886,798 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everybody,

I made a really simple camera app (it shoots a series of pictures in user-defined intervals), which was compiled for platform WP 7.1 (I think OS version 7.5 and 7.8) which works fine on my old ZTE Tania (it's running 7.8). I have uploaded it to the Store, it passed certification, but I see crashes under Windows Phone 8.1.

I see the following in the Dashboard:
Symbol Name:
Microsoft_Devices_Camera_ni!Microsoft.Devices.PhotoCamera.CheckInitAndCaptureComplete

Failure Name:
CLR_EXCEPTION_System.InvalidOperationException_80131509_Microsoft.Devices.Camera.dll!Microsoft.Devices.PhotoCamera.CheckInitAndCaptureComplete


I see, that somebody is using it under Windows 10 (Mobile) and there're no reported crashes for that system.

Is it a problem in code or some user-device specific issue?
This is my camera init code:

C#
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            sw = new Stopwatch();

            timer = new DispatcherTimer();
            timer.Tick += new EventHandler(timer_Tick);

            cam = new Microsoft.Devices.PhotoCamera(CameraType.Primary);
            currentPhotoPath = string.Empty;
            lib = new MediaLibrary();


            cam.CaptureCompleted += new EventHandler<CameraOperationCompletedEventArgs>(cam_CaptureCompleted);
            cam.CaptureImageAvailable += new EventHandler<ContentReadyEventArgs>(cam_CaptureImageAvailable);


            cam.Initialized += new EventHandler<CameraOperationCompletedEventArgs>(cam_Initialized);

            viewFinderBrush.SetSource(cam);

            CameraButtons.ShutterKeyHalfPressed += new EventHandler(CameraButtons_ShutterKeyHalfPressed);
            CameraButtons.ShutterKeyPressed += new EventHandler(CameraButtons_ShutterKeyPressed);
        }


and handler for camera initialized event:
C#
void cam_Initialized(object sender, CameraOperationCompletedEventArgs e)
        {
            Dispatcher.BeginInvoke(() =>
            {
                //get camera's supported resolutions
                availableSizes = new List<Size>(cam.AvailableResolutions);

                //update UI to show camera's supported resolutions
                resolutionPicker.ItemsSource = availableSizes;

                IsolatedStorageSettings iss = IsolatedStorageSettings.ApplicationSettings;

                //check if flash settings were saved and read them, or set to auto (UI index 0)
                flashPicker.SelectedIndex = iss.Contains(FLASH_SETTING) ? (int)iss[FLASH_SETTING] : 0;

                //read save resolution or set to the highest one
                resolutionPicker.SelectedIndex = iss.Contains(RESOLUTION_SETTING) ? (int)iss[RESOLUTION_SETTING] : availableSizes.Count - 1;
            });
        }


I have Visual Studio 2010 Express for Windows Phone installed and at this moment I can't install 8.1 tools to VS2013, but I don't know if repacking would help and I don't own 8.1 device to test it :) .

Thanks in advance!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900