jamesmontemagno / Xamarin.Plugins

Cross-platform Native API Access from Shared Code!
MIT License
1.3k stars 380 forks source link

[Media] Windows Phone RT 8.1 - Bug in the TakePhotoAsync() method #321

Closed avorobjovs closed 8 years ago

avorobjovs commented 8 years ago

Please take a moment to fill out the following (change to preview to check or place x in []) and remove all unused areas

This is a

Which plugin does this impact:

Version Number of Plugin: 2.3.0 Device Tested On: Nokia Lumia 830, Windows Phone 8.1 Update 2, OS version 8.10.15148.160 Simulator Tested On:

Expected Behavior

The TakePhotoAsync() method returns MediaFile object.

Actual Behavior

The TakePhotoAsync() method raises an exception.

Steps to reproduce the Behavior

  1. Create new Windows Phone RT 8.1 application.
  2. Add a button to the MainPage.xaml
  3. Add an event handler method for the button to the MainPage.xaml.cs code-behaviour file,
  4. In the event handler method call the CrossMedia.Current.Initialize() method, then call the CrossMedia.Current.TakePhotoAsync() method.
  5. The "Windows.UI.Xaml.Markup.XamlParseException: XAML parsing failed." exception is thrown.

Full exception stack trace:

Windows.UI.Xaml.Markup.XamlParseException: XAML parsing failed. at Windows.UI.Xaml.Application.LoadComponent(Object component, Uri resourceLocator, ComponentResourceLocation componentResourceLocation) at DMX.Helper.CameraCaptureUI.InitializeComponent() at DMX.Helper.CameraCaptureUI..ctor() at Plugin.Media.MediaImplementation.d16.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Media.WP.MainPage.d11.MoveNext()

There is a small test project in the attachment to check and reproduce this bug.

Media.WP.zip

abhimanyusinghal commented 8 years ago

We are also getting same exception in our project

Thowk commented 8 years ago

Same issue here. The problem is caused by project configuration. Xaml files are missing in output library. At least, some workaround exist (simply manually compile that project and reference): http://forums.xamarin.com/discussion/comment/201503/#Comment_201503

jamesmontemagno commented 8 years ago

This issue was moved to jamesmontemagno/MediaPlugin#5