jamesmontemagno / ImageCirclePlugin

Circle Images for your Xamarin.Forms Applications
MIT License
239 stars 68 forks source link

Image not loading from uri in UWP #7

Closed iamsid closed 8 years ago

iamsid commented 8 years ago

Bug

Image not showing. Tried binding image URL string and URI. Working when setting image source from stream. I updated to the latest version because in earlier version, image source 'from stream' was not working. Now, 'from stream' is working but 'from URI' is broken. Working in Android as expected.

Went through the source code. UWP is missing the ImageRenderer.cs file.

Version Number of Plugin: 1.6.0.8 Device Tested On: Windows 10 10586.494, Lumia 535 Windows 10 14393.5

iamsid commented 8 years ago

Downgraded to 1.4.1. URI image source working again. Stream image source broken again.

jamesmontemagno commented 8 years ago

Testing it out to see what happens as that was the version Stream was fixed...

jamesmontemagno commented 8 years ago

Hmmmmm I don't seem to have this issue with the test projects at all.... How are you setting it?

jamesmontemagno commented 8 years ago

Can you open up: https://github.com/jamesmontemagno/ImageCirclePlugin/tree/master/tests and test out?

iamsid commented 8 years ago

Test project is working fine. The control is using Xamarin.Forms 2.3.0.107, while the UWP test project has Xamarin.Forms 2.3.1.114 installed.

My solution (Native Portable, Android & UWP) has 2.3.1.114 installed. Issue still persists on my project. 1.6.0.8: URI not working. Stream working. 1.4.1: URI working. Stream not working.

I am using the control in XAML, binding string URL of image. I also tried setting the image from C#, but didn't work either.

XAML: <... Source="{Binding profile_picture}" ...>

C#: imgProfile.Source = ImageSource.FromUri(new Uri(contact.profile_picture));

NOTE: I encountered an error while running the test solution. The ImageCircle.Forms.Plugin.Abstractions.csproj contains an error validation for package, but the path where its looking for package is incorrect.

iamsid commented 8 years ago

Another thing I forgot to mention is that I have used the image control in a list as well as a single image. List uses URI. Single control uses both URI and stream, exclusively.

iamsid commented 8 years ago

Created a new Xamarin portable project with Portable, Android & UWP projects: Images still not loading in list view. Single control working fine for both URI & stream source.

The single control in my main project is still not being able to load image. I even set a static source URL in the XAML itself. Have even tried cleaning the solution, re-deployed the app multiple times, but issue persists. I noticed numerous "The thread 0xe88 has exited with code 0 (0x0)." in output window every time the page with image control loads.

Android on the other hand, works fine. Both the projects.

jamesmontemagno commented 8 years ago

Are you sure that you have all the NuGets updated in all projects? If it is in UWP maybe make sure the project.json.lock has the right reference.

iamsid commented 8 years ago

I have update for UniversalWindowsPlatform 5.2.2. I had updated it earlier, but there is a bug in this release, preventing me to publish the UWP app to store. So, downgraded again and everything worked fine again. Test project is on the v5.0.0, so that is not the issue.

project.lock.json has correct references.

I am still trying to figure it out. Turns out, after I removed the 'FFImage..' package (I think this was either installed with some other package, but I didn't remove it), and re-installed the latest version of ImageCircle, there is improvement. Now the control is showing image in the individual control: both URI & stream are working.

But, the list view is still not working. In both debug & release mode, the list controls appear empty. I just get numerous exceptions in release mode, debug mode does not show that either. Below exception repeat for each row.

Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.Threading.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in Xamarin.Forms.Core.dll

Could you please try using a xaml list view & bind a list of URIs, to reproduce in UWP?

jamesmontemagno commented 8 years ago

In release mode did you include the assembly so it doesn't get linked out?

https://github.com/xamarinhq/app-evolve/blob/master/src/XamarinEvolve.UWP/App.xaml.cs#L93-L129

Sounds like it is all fine? I haven't had any other reports at all to be honest.

iamsid commented 8 years ago

Yes I have. But only these two:

assembliesToInclude.Add(typeof(ImageCircle.Forms.Plugin.UWP.ImageCircleRenderer).GetTypeInfo().Assembly); assembliesToInclude.Add(typeof(ImageCircle.Forms.Plugin.Abstractions.CircleImage).GetTypeInfo().Assembly);

Should I do this for all 3rd party packages?

If you could test with a list view once, it would be helpful.

iamsid commented 8 years ago

In release build, with ImageCircle v1.4.1, I get the following exception for cases when bound value is null: Exception thrown: 'System.UnauthorizedAccessException' in System.Private.CoreLib.dll

In release build, with v1.6.0.8, I get a combination of following exception, for both cases when bound value is null & not null:

Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.Threading.dll
Exception thrown: 'System.OperationCanceledException' in System.Private.CoreLib.dll
Exception thrown: 'System.OperationCanceledException' in Xamarin.Forms.Core.dll

With 1.4.1, the application runs well. I just don't have support for stream source. But with 1.6.0.8, the UI gets unresponsive due to numerous exceptions. Also, in 1.6.0.8 not setting any source results in "System.IO.FileNotFoundException" in "ImageCircle.Forms.Plugin.UWP.dll". No such exception in 1.4.1

jamesmontemagno commented 8 years ago

This happens when a value is null? do you have a small code behind repo? I can try it in a list view.... i assume that is it just a bunch of urls?

iamsid commented 8 years ago

Please download the fresh Xamarin.Forms project I created for testing, from here. Please rebuild as I have removed the bin & obj folder to reduce the size of upload.

In list view, when source is null or not, the multiple exceptions are generated. Basically its just not working.

When using a single image circle control with no source, 1.6.0.8 results in "Exception thrown: 'System.NullReferenceException' in ImageCircle.Forms.Plugin.UWP.dll". Earlier version did not show any exception in this case. I use this for showing a filled circle in my UI.

Please run the project in 'Release' mode. 'Debug' mode runs the application same as release, but does not show any exceptions in the Output window.

aherrick commented 8 years ago

I too am seeing similar behavior in 1.6.0.8 with the latest version of Xamarin Forms in UWP. No exceptions are thrown but the images simply do not show up. Downgrading to 1.4.1 the images from URIs show again.

8-8-2016 11-46-01 am

aherrick commented 8 years ago

After further review with 1.4.1 I was simply binding the CircleImage source to a string of the ImageURL. I tried updating my Model/Binding to include a property to return the ImageSource with 1.6.0.8 based on the README.

Still no go.

8-8-2016 11-55-16 am

8-8-2016 11-56-27 am

iamsid commented 8 years ago

@aherrick : Are you using this control in a listview? I was able to get the image from URL, both as string & ImageSource, when using on a stand-alone single control, using binding & setting the parameter directly. But, when using with listview control, it just kept generating exceptions.

jamesmontemagno commented 8 years ago

Can you try: https://www.nuget.org/packages/Xam.Plugins.Forms.ImageCircle/1.6.1-beta10

I reverted a bunch of code, but added back the stream part.

aherrick commented 8 years ago

@jamesmontemagno working great!

jamesmontemagno commented 8 years ago

@iamsid can you verify and check the stream stuff too.

Will push live once verified.

iamsid commented 8 years ago

My laptop got damaged from rain yesterday. Haven't found a test machine yet. Will try to test the package asap.


From: James Montemagnomailto:notifications@github.com Sent: ‎09-‎08-‎2016 01:10 To: jamesmontemagno/ImageCirclePluginmailto:ImageCirclePlugin@noreply.github.com Cc: iamsidmailto:siddhant1991@outlook.com; Mentionmailto:mention@noreply.github.com Subject: Re: [jamesmontemagno/ImageCirclePlugin] Image not loading from uri in UWP (#7)

@iamsid can you verify and check the stream stuff too.

Will push live once verified.


You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/jamesmontemagno/ImageCirclePlugin/issues/7#issuecomment-238351842

jamesmontemagno commented 8 years ago

OH NO :( i am sorry to hear that @iamsid

I'll try to run your sample with the new package.

iamsid commented 8 years ago

Hi @jamesmontemagno , Finally set up a new PC today. Old one damaged beyond repair. :(

Tested out the new build on test project. Everything seems to be working great now. Binding controls, setting stream source, settings image url source.. all working!! Thank you for your patience.

I have not encountered any new issue with the given beta so far. Hope to see a new release soon which I can integrate in my main app. :)

jamesmontemagno commented 8 years ago

Releasing 1.6.1 today, thanks!

erportico commented 8 years ago

Hi @jamesmontemagno, I've updated your component with the latest version but I still have the same error of @iamsid for UWP. On Android and iOS is working fine

iamsid commented 8 years ago

@erportico Make sure you have added all references in the UWP project's App.xaml.cs file.