Ffimageloading: Xamarin Forms 2.2 support

Created on 18 Apr 2016  路  49Comments  路  Source: luberda-molinet/FFImageLoading

@daniel-luberda Hi,

Sorry to say that in indeed it's a FFImageLoading issue, but I think is an easy one, since in this new pre-release version of Xamarin.Forms they moved to Xamarin.Android.Support.v4(and Friends) to version 23.1.1.1 all you need to do is just re-build the nugget packages with that version.

For confirming that it's a FFImageLoading I tried removing all packages from my project, install lates pre-release of Xamarin.Forms 2.2.0.5-pre2, install again all packages that I was using except FFImageLoading and try to build, and It succeeded, then Add FFImageLoading and try to build, it failed with the errors I posted before.
After that I created a new project, installed Xamarin.Forms 2.2.0.5-pre2, build succeeded, install FFImageLoading and Failed again.
I was reading in the same post you point it out and people says they are having this issues with 3rd party libs that need to update their Xamarin.Android.Support.v4(and Friends) to version 23.1.1.1

Thank You

Xamarin.Forms

Most helpful comment

@lecnierfreeman Thanks for the info. I didn't test alpha Xamarin.Forms yet. I'll give it a look soon.

All 49 comments

@lecnierfreeman Thanks for the info. I didn't test alpha Xamarin.Forms yet. I'll give it a look soon.

I can confirm and I just recompiled FFImageLoading.Forms.Droid w/ Forms 2.2.0.5-pre4 and all is back to normal. I think I'm gonna wait for you guys to release on NuGet with the update.

Awesome Work! Love this Plugin.

@daniel-luberda I'm using XF 2.2.0.23-pre4 and having the same issues. I have Android Support library 23.3.0 and FFImageLoading 2.1.0-alpha1. Would really like to see a fix as soon as possible. @ryanherman Did you mean 2.2.0.5-pre2?

Xamarin Forms 2.2.0 stable just got released, any chance you can get a new nuget package out so we can use the new forms build in Android? Thanks :)

Have same errors, as above. Can not get it to work with latest stable Forms build on Android. Shows multiple "missing resource" errors

Upgraded xamarin forms to version 2.2, I can't build, same issue as others.

This is really urgent. 2.2 is a stable release now and it doesn't build with FFImageLoading.

@daniel-luberda Is it fixed in master?

@molinch Yes, sort of. The XF packages aren't updated in the Master yet. But if you do update them and build, it's running fine.
Currently running the new compiled version on beta's on iOS and Android for about a week now, without problems.

Thanks for the feedback @timbrand !

Would you mind making a PR where you update all XF projects (lib and samples) to the latest version?
Since I don't have VS it is complicated to update WP projects.

@molinch I'll fix that and release alpha nuget now.

Thank You, Thank You, Thank You, I've been waiting for this two weeks, couldn't build Android.

FFImageLoading 2.1.0-alpha2 nuget with Xamarin.Forms 2.2.0.31 support released. If you have any problems, please write details here. Thanks.

can confirm it works.
but only after you add the references to the platform-specific project, too.

i'm pretty new to the xamarin-thing so i don't know if that's normal.

At the moment, I'm getting a weird Exception in thread "main" error in COMPILETODALVIK or
COMPILETODALVIK : UNEXPECTED TOP-LEVEL error

I noticed this might be the solution, but I haven't tried it yet: http://www.onthefencedevelopment.com/blog/2014/6/29/fixing-xamarin-compiletodalvik-build-error-in-vs2013

UPDATE: Upping the heapsize to 1G fixed the problem, but I'm not sure why I had to do that as I don't have GooglePlay packages.

@adrianknight89 TBH I don't know why you got this but it definitely seems to be a Xamarin or Android issue
Thanks for posting the solution! It will be useful in case somebody else gets it in the future.

@krisrok Yes that's the normal scenario :)

I have done some testing over the past couple of hours. The XF2.2 version compiles/runs for me.

However, I am seeing some perf degradation in the alpha nugets compared to the original nugets. My observations:
1- Loading the images on start-up (from DiskCache I'm guessing) seems particularly slow as well. If I turn the app off/on there is always a long lag at the beginning until the images show up. This lag feels slower than what I had in the previous FF nugets.

2- Are the images loaded in a different order than before? Looks like some of the last ones now show up first. This could be what's causing the slowness perception.

Is this expected? Is it possible to revert to the "old" method of caching within this nuget?

Does the latest build really depend on XF2.2? I have a lot of issues with XF 2.2 right now on Android so I am holding off on upgrading.

@patook I created https://github.com/molinch/FFImageLoading/issues/188 for your issue it will be easier to continue there

FYI we have the latest version of FFImageLoading (compiled from source) with XF2.2 in production for the past two days on iOS and things are stable.

@daniel-luberda Can I let you answer @ravensorb's question?

@ravensorb Yes, It depends on it. I'll try to make two nugets on release "old Forms" and "new Forms" as those builds are not compatible.

Interesting -- what changed that sets the hard dependency?

Actually, Xamarin.Forms 2.2 (Android App Compat packages) itself, I'll try to investigate if we can do something about it to be independent of that.

I don't think you can. If you use the android app compat packages, you have to set the nuget dependency to a specific version (just as Forms does). Or you could depend on a Forms version range (2.1.X or 2.2.X), which in turn would depend on a specific AppCompat version...

@tobiasschulz Thanks to info from @aritchie, we'll probably have this sorted out and be compatible with all XF versions in one package:

remove resources.cs and edit your csproj. Remove <AndroidResgenFile>

2.1.0-rc1 nuget released. As always, testers needed. That nuget should work on any Xamarin.Forms version (< 2.2 & >= 2.2) on Android.

@ravensorb @patook @adrianknight89 @krisrok @lecnierfreeman Could you please test the release candidate and tell us in case you find anything weird?
We would like to release it this as soon as possible.

Thanks !

@molinch The build I got from source has been in production on the iOS app store for over a week and is running perfectly. I have had zero crashes in the last 5,000 sessions with the 2.1 build (and XF2.2).

Hmmm this is really bugging me, I am having absolutely major issues with 2.1.0-rc1 with xamarin forms 2.2. Images aren't getting cached. I have them in a list view, they get downloaded each time. When I click on the cell to go to next page, the same image is again displayed in the content page, and it's getting re downloaded. I close the app, turn off net, open the app, and images are not there, error place holder is shown. Also in my list view scrolling through the list, you can see other images briefly be loaded where they shouldn't be.

My bindings are in the XAML
WidthRequest="100"
HeightRequest="100"
DownsampleToViewSize="true"
DownsampleUseDipUnits="true"
Aspect="AspectFill"
LoadingPlaceholder="ImageLoading.png"
ErrorPlaceholder="ImageLoadingError.png"
Source="{Binding FirstImage}" />

@michaeldimoudis Did you try the newest nuget (RC1)? Is it on Android/iOS?Do you use any custom configuration? I'll need more details.

Yea I'm on RC1. It's iOS. I'll fire up Android and see if it's the same...

@daniel-luberda it's fine on Android. Just iOS is my issue... I'll keep trying some things, cleaning, resetting sim, etc.

@michaeldimoudis It has to be something specific to your project. Do you empty any caches? Do you preserve caches between app deploys?

@daniel-luberda nop, just a stock standard implementation. I init it in AppDelegate, and just call CachedImage where I need to. The only non standard thing is my ImageService initialize which is this. This all worked as expected before I upgraded forms and FFImageLoading nuget packages.

        ImageService.Instance.Initialize(new Configuration
        {
            FadeAnimationDuration = 50, 
            HttpClient = new HttpClient (new AuthenticatedHttpImageClientHandler (() => new SecureStorage ()))
        });

It is so weird, that if I load the image in the ListView, and then go to another page with the same image, it re downloads it arrrgghh :(

I'm on the beta channel of Xamarin Studio. If I have time later I might go to the previous branch with the stable nuget, and see if this anomaly keeps happening... I pretty much just updated the nuget package, and converted my ListView to have DataTemplateSelector and that's all...

@daniel-luberda Ok there is something weird going on with FFImageLoading 2.1.0 on iOS, I restored my project back to master with xamarin forms 2.0 and FFImageLoading 2.0.7.1, worked as expected, cached when offline as expected. I then only updated FFImageLoading to 2.1.0 rc1 and images don't get cached. Obviously I let the app re download the images on 2.1.0, closed app and turned off my wifi, opened app, and all images were now broken. I did get this error in the output window once, not sure if it's much help: WARNING: An HttpWebRequest was added to the ConnectionGroup queue because the connection limit was reached.

It's approaching midnight where I am, so I'll leave this here, if you need me to do any other debugging let me know.

You are right I confirm the issue. I'm working on it.
Many thanks for reporting it 馃憤

@molinch is this something that was newly introduced in the last week? I have last week's build of 2.1 from source and am not seeing such an error (I think).

@patook the bug is only on iOS

@michaeldimoudis fixed in git, should be available soon via nuget

@molinch no probs, glad this was caught now not later :) Nuget isn't updated yet, you get an ETA for that? Cheers.

Hi @molinch are the RC2 nugets up?

@patook you can look it up yourself at https://www.nuget.org/packages/Xamarin.FFImageLoading/
just scroll down to the version history. the topmost entry is the newest version available on nuget.

Unfortunately Daniel's PC is broken now: some liquid fell on it.
So we will need to wait 1 or 2 additional days before having the final nuget.
Meanwhile you can use, as krisrok said, the prerelease nugets.

Released 2.1.0-rc2 nuget, feel free to test it as it's stable candidate. If you're using 2.1.0-rc1 on iOS, it's very important to update as that version has a bug that causes caching to be disabled. Thanks.

i am still hitting the corrupt data error after loading the latest version.

Unable to read package from path 'Xamarin.FFImageLoading.Forms.2.1.0-rc2\Xamarin.FFImageLoading.Forms.2.1.0-rc2.nupkg'.
  File contains corrupted data.

+1

2.1 released which supports new XF and fixes corrupted package issue.
Many thanks @ravensorb for your help and debugging!

Was this page helpful?
0 / 5 - 0 ratings