FFImageLoading
FFImageLoading copied to clipboard
FFImageLoading.Exceptions.DownloadAggregateException: One or more errors occurred. (Headers timeout)
I am working in xamarin android project and loading image using this library with authentication header. I have send headers to this library in my MainActivity and loading image in another activity.
This works fine in xamarin iOS but in Xamarin Android getting header timeout error.
FFImageLoading nuget version : Xamarin.FFImageLoading.2.4.11.982
Please provide solution to fix this issue
I am having the same output message only on Android.
In my XAML, I have the following:
<ffcache:CachedImage x:Name="HackneyLogo" HorizontalOptions="CenterAndExpand" VerticalOptions="FillAndExpand" WidthRequest="{StaticResource LogoWidthSize}" Aspect="AspectFit" RetryCount="3" RetryDelay="20" CacheType="All" CacheDuration="500" Scale="0.95" DownsampleToViewSize="True"/>
And in my code-behind I am simply declaring the Source:
HackneyLogo.Source = new UriImageSource { Uri = new Uri(DataHelpers.GetLogo(1)) };
DataHelpers.GetLogo(int i) { } simply returns the string value of the URL from which the image is loaded.
As stated previously, this works just fine on iOS - I have no issue loading the image, but on Android my images do not get loaded.
I am getting this issue as well. Stacktrace included below:
05-21 11:40:41.821 I/mono-stdout(11846): Image loading failed: a7215c38-4727-4e04-ad2a-940f61b49c97Image loading failed: a7215c38-4727-4e04-ad2a-940f61b49c97 FFImageLoading.Exceptions.DownloadAggregateException: One or more errors occurred. (Headers timeout) ---> FFImageLoading.Exceptions.DownloadHeadersTimeoutException: Headers timeout at FFImageLoading.Cache.DownloadCache.DownloadAsync (System.String url, System.Threading.CancellationToken token, System.Net.Http.HttpClient client, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.DownloadInformation downloadInformation) [0x007c3] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:195 at FFImageLoading.Cache.DownloadCache+<>c__DisplayClass15_0.<DownloadAndCacheIfNeededAsync>b__0 () [0x00050] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:58 at FFImageLoading.Retry.DoAsync[T] (System.Func`1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x00047] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\Retry.cs:19
05-21 11:40:41.826 I/mono-stdout(11846): FFImageLoading.Exceptions.DownloadAggregateException: One or more errors occurred. (Headers timeout) ---> FFImageLoading.Exceptions.DownloadHeadersTimeoutException: Headers timeout
--- End of inner exception stack trace ---
at FFImageLoading.Retry.DoAsync[T] (System.Func1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x0023b] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\Retry.cs:65 at FFImageLoading.Cache.DownloadCache.DownloadAndCacheIfNeededAsync (System.String url, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.Config.Configuration configuration, System.Threading.CancellationToken token) [0x00401] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:57 at FFImageLoading.DataResolvers.UrlDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x00045] in C:\projects\ffimageloading\source\FFImageLoading.Common\DataResolvers\UrlDataResolver.cs:22 at FFImageLoading.DataResolvers.WrappedDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, 05-21 11:40:41.826 I/mono-stdout(11846): at FFImageLoading.Cache.DownloadCache.DownloadAsync (System.String url, System.Threading.CancellationToken token, System.Net.Http.HttpClient client, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.DownloadInformation downloadInformation) [0x007c3] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:195 System.Threading.CancellationToken token) [0x0004e] in C:\projects\ffimageloading\source\FFImageLoading.Common\DataResolvers\WrappedDataResolver.cs:21 at FFImageLoading.Work.ImageLoaderTask3[TDecoderContainer,TImageContainer,TImageView].RunAsync () [0x00300] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:618
---> (Inner Exception #0) FFImageLoading.Exceptions.DownloadHeadersTimeoutException: Headers timeout
at FFImageLoading.Cache.DownloadCache.DownloadAsync (System.String url, System.Threading.CancellationToken token, System.Net.Http.HttpClient client, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.DownloadInformation downloadInformation) [0x007c3] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:195
at FFImageLoading.Cache.DownloadCache+<>c__DisplayClass15_0.<DownloadAndCacheIfNeededAsync>b__0 () [0x00050] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:58
at FFImageLoading.Retry05-21 11:40:41.826 I/mono-stdout(11846): at FFImageLoading.Cache.DownloadCache+<>c__DisplayClass15_0.<DownloadAndCacheIfNeededAsync>b__0 () [0x00050] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:58
.DoAsync[T] (System.Func1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x00047] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\Retry.cs:19 <--- 05-21 11:40:41.826 I/mono-stdout(11846): at FFImageLoading.Retry.DoAsync[T] (System.Func1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x00047] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\Retry.cs:19
05-21 11:40:41.827 I/mono-stdout(11846): --- End of inner exception stack trace ---
05-21 11:40:41.827 I/mono-stdout(11846): at FFImageLoading.Retry.DoAsync[T] (System.Func1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x0023b] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\Retry.cs:65 05-21 11:40:41.827 I/mono-stdout(11846): at FFImageLoading.Cache.DownloadCache.DownloadAndCacheIfNeededAsync (System.String url, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.Config.Configuration configuration, System.Threading.CancellationToken token) [0x00401] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:57 05-21 11:40:41.827 I/mono-stdout(11846): at FFImageLoading.DataResolvers.UrlDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x00045] in C:\projects\ffimageloading\source\FFImageLoading.Common\DataResolvers\UrlDataResolver.cs:22 05-21 11:40:41.828 I/mono-stdout(11846): at FFImageLoading.DataResolvers.WrappedDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0004e] in C:\projects\ffimageloading\source\FFImageLoading.Common\DataResolvers\WrappedDataResolver.cs:21 05-21 11:40:41.828 I/mono-stdout(11846): at FFImageLoading.Work.ImageLoaderTask3[TDecoderContainer,TImageContainer,TImageView].RunAsync () [0x00300] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:618
05-21 11:40:41.829 I/mono-stdout(11846): ---> (Inner Exception #0) FFImageLoading.Exceptions.DownloadHeadersTimeoutException: Headers timeout
05-21 11:40:41.829 I/mono-stdout(11846): at FFImageLoading.Cache.DownloadCache.DownloadAsync (System.String url, System.Threading.CancellationToken token, System.Net.Http.HttpClient client, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.DownloadInformation downloadInformation) [0x007c3] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:195
05-21 11:40:41.829 I/mono-stdout(11846): at FFImageLoading.Cache.DownloadCache+<>c__DisplayClass15_0.<DownloadAndCacheIfNeededAsync>b__0 () [0x00050] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:58
05-21 11:40:41.829 I/mono-stdout(11846): at FFImageLoading.Retry.DoAsync[T] (System.Func`1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x00047] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\Retry.cs:19 <---
05-21 11:40:41.830 I/mono-stdout(11846):
05-21 11:40:42.664 W/monodroid-assembly(11846): typemap: unable to find mapping to a Java type from managed type 'System.Byte, mscorlib'
I'm having the same issue only on android. This is my stack trace: Image loading failed: https://media.joomeo.com/private/ZmU1MXM2ZjMQThCSd7PAzcDH5yzu8iW_rxgw0kfnow5sc3nbB2qJaA/medium/MVpKWEMwNEpaV2qvLidZaw/cover.jpg FFImageLoading.Exceptions.DownloadAggregateException: One or more errors occurred. (Headers timeout) (Headers timeout) (Headers timeout) (Headers timeout) ---> FFImageLoading.Exceptions.DownloadHeadersTimeoutException: Headers timeout at FFImageLoading.Cache.DownloadCache.DownloadAsync (System.String url, System.Threading.CancellationToken token, System.Net.Http.HttpClient client, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.DownloadInformation downloadInformation) [0x007c3] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:195 at FFImageLoading.Cache.DownloadCache+<>c__DisplayClass15_0.<DownloadAndCacheIfNeededAsync>b__0 () [0x00050] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:58 at FFImageLoading.Retry.DoAsync[T] (System.Func`1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x00047] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\Retry.cs:19 --- End of inner exception stack trace ---
Same here...
@ at FFImageLoading.Retry.DoAsync[T] (System.Func1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) <0x8a886c60 + 0x00a00> in <a159011f32534c8eb0455a9cf0bad5a7>:0 at FFImageLoading.Cache.DownloadCache.DownloadAndCacheIfNeededAsync (System.String url, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.Config.Configuration configuration, System.Threading.CancellationToken token) [0x0044b] in <a159011f32534c8eb0455a9cf0bad5a7>:0 at FFImageLoading.DataResolvers.UrlDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0008f] in <a159011f32534c8eb0455a9cf0bad5a7>:0 at FFImageLoading.DataResolvers.WrappedDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x00098] in <a159011f32534c8eb0455a9cf0bad5a7>:0 at FFImageLoading.Work.ImageLoaderTask3[TDecoderContainer,TImageContainer,TImageView].RunAsync () <0x8a88da84 + 0x01003> in
InnerException: mscorlib - Headers timeout @ at FFImageLoading.Cache.DownloadCache.DownloadAsync (System.String url, System.Threading.CancellationToken token, System.Net.Http.HttpClient client, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.DownloadInformation downloadInformation) [0x007c8] in
Same here...
FFImageLoading.Exceptions.DownloadAggregateException: One or more errors occurred. (Headers timeout) ---> FFImageLoading.Exceptions.DownloadHeadersTimeoutException: Headers timeout
at FFImageLoading.Cache.DownloadCache.DownloadAsync (System.String url, System.Threading.CancellationToken token, System.Net.Http.HttpClient client, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.DownloadInformation downloadInformation) [0x007c3] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:195
at FFImageLoading.Cache.DownloadCache+<>c__DisplayClass15_0.<DownloadAndCacheIfNeededAsync>b__0 () [0x00050] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:58
at FFImageLoading.Retry.DoAsync[T] (System.Func`1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x00047] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\Retry.cs:19
--- End of inner exception stack trace ---
at FFImageLoading.Retry.DoAsync[T] (System.Func`1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x0023b] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\Retry.cs:65
at FFImageLoading.Cache.DownloadCache.DownloadAndCacheIfNeededAsync (System.String url, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.Config.Configuration configuration, System.Threading.CancellationToken token) [0x00401] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:57
at FFImageLoading.DataResolvers.UrlDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x00045] in C:\projects\ffimageloading\source\FFImageLoading.Common\DataResolvers\UrlDataResolver.cs:22
at FFImageLoading.DataResolvers.WrappedDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0004e] in C:\projects\ffimageloading\source\FFImageLoading.Common\DataResolvers\WrappedDataResolver.cs:21
at FFImageLoading.Work.ImageLoaderTask`3[TDecoderContainer,TImageContainer,TImageView].RunAsync () [0x00300] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:618
at FFImageLoading.TaskParameterPlatformExtensions.AsJPGStreamAsync (FFImageLoading.Work.TaskParameter parameters, System.Int32 quality) [0x00029] in C:\projects\ffimageloading\source\FFImageLoading.Droid\Extensions\TaskParameterPlatformExtensions.cs:39
at XXXXXXX () [0x001d8] in C:\Users\XXX
---> (Inner Exception #0) FFImageLoading.Exceptions.DownloadHeadersTimeoutException: Headers timeout
at FFImageLoading.Cache.DownloadCache.DownloadAsync (System.String url, System.Threading.CancellationToken token, System.Net.Http.HttpClient client, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.DownloadInformation downloadInformation) [0x007c3] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:195
at FFImageLoading.Cache.DownloadCache+<>c__DisplayClass15_0.<DownloadAndCacheIfNeededAsync>b__0 () [0x00050] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:58
at FFImageLoading.Retry.DoAsync[T] (System.Func`1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x00047] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\Retry.cs:19 <---
any update on this? receiving this now too, but the images sometimes load. Not sure how to pinpoint, as I'm using this on a listview with quite a few items...
Same error
the same upd: Fixed via removing "UseLegacyRenderer" flag from Forms.SetFlags()
the same upd: Fixed via removing "UseLegacyRenderer" flag from Forms.SetFlags()
@jocontacter, I'm curious, the "UseLegacyRenderer" flag does not seem to be documented, how did you use it exactely? Any other side effects on other components?
Thanks for sharing a solution.
Same here. Are there any news regarding this issue?
I checked and I havent set "UseLegacyRenderer", so I dont think it is a viable solution
Thanks in advance
Are there any news on this issue?
Having same issue, anyone?
Here is a "solution" that works fine.
var handler = new HttpClientHandler();
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
handler.ServerCertificateCustomValidationCallback =
(httpRequestMessage, cert, cetChain, policyErrors) => true;
var client = new HttpClient(handler);
ImageService.Instance.Initialize(new Configuration
{
HttpClient = client
});
Here is a "solution" that works fine.
Ignoring certificate validation errors is a workaround, but it's not really solving the problem, it's just bypassing security.
Here is a "solution" that works fine.
Ignoring certificate validation errors is a workaround, but it's not really solving the problem, it's just bypassing security.
Yes that's why I wrote it in quotes... ;)
For me this was caused by a timeout while getting http headers, so I just increased the timeout:
ImageService.Instance.Initialize(new FFImageLoading.Config.Configuration
{
HttpHeadersTimeout = 60
});