jamesmontemagno / Xamarin.Plugins

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

How to solve Xaml parsing error for media.plugin in windows phone 8.1 PCL project? #269

Closed rylegale closed 8 years ago

rylegale commented 8 years ago

Please take a moment to fill out the following (change to preview to check or place x in []):

This is a Bug

Which plugin does this impact: Media

Version Number of Plugin: 2.3.0 Device Tested On: Simulator Tested On: Windows Phone 8.1

Expected Behavior

Actual Behavior

XAML parsing failed.

Steps to reproduce the Behavior

I've created a PCL project and the plugin is working so good in Android and iOS but not in Windows Phone 8.1 RT, I've added the lines in App.xaml.cs but when I try to take picture, it throws an error XAML parsing failed in TakePhotoAsync method. I've also tried to download and manually added the dll file but again the same error.

rylegale commented 8 years ago
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.<TakePhotoAsync>d__16.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 SwachhParyatanApp.Complaint.<>c__DisplayClass1_0.<<-ctor>b__0>d.MoveNext()
avorobjovs commented 8 years ago

Hello!

I have installed the Xam.Plugin.Media (version 2.3.0) on my Xamarin.Forms (version 2.1.0.6529, PCL) project and have the same problem. I have tested it on 2 WindowsPhone devices and get such exceptions on both of them while I call the TakePhotoAsync() method. At the same time the PickPhotoAsync() method works good.

Do you have a plan to fix this bug?

This feature (take a photo) is a critical for our application.

Best Regards, Aleksandrs

fedeberco commented 8 years ago

Same problem here @avorobjovs !

Any solution? @jamesmontemagno

rylegale commented 8 years ago

@FBerco I found the solution, you can download the sourcecode from github and then open it in visual studio and manually compile it and make sure to copy the two cameracapture xaml file manually to your project and it'll e working file

fedeberco commented 8 years ago

@rylegale CameraCaptureUI.xaml and CameraCaptureUiPage.xaml?? To where directory do I paste it?

jamesmontemagno commented 8 years ago

This issue was moved to jamesmontemagno/MediaPlugin#16

jamesmontemagno commented 8 years ago

Fixed officially in 2.5.1-beta33! Tested and shipped!