Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No service for type 'FFImageLoading.IImageService' has been registered. #51

Open
Noplace opened this issue Oct 1, 2024 · 4 comments
Open

Comments

@Noplace
Copy link

Noplace commented Oct 1, 2024

Description

Hi, I have added the library to my project, it works fine on Android but throws the error "No service for type 'FFImageLoading.IImageService' has been registered. " when testing on iOS.

I tried adding it manually via Services.AddSingleton but then it asked for IPlatformService or so and I just left it.

the exception is thrown when the below element is loaded with items via the binding

  <CarouselView x:Name="x" Loop="True" ItemsSource="{Binding items}" HeightRequest="100" VerticalOptions="FillAndExpand" IndicatorView="indicatorView"  >
      <CarouselView.ItemTemplate>
          <DataTemplate  x:DataType="contracts:item">
              <ff:CachedImage Source="{Binding ImageUrl}" HorizontalOptions="FillAndExpand" VerticalOptions="Start"  Aspect="AspectFill"  >
                  <ff:CachedImage.GestureRecognizers>
                      <TapGestureRecognizer  Command="{Binding command, Source={RelativeSource AncestorType={x:Type vm:basevm}}}" CommandParameter="{Binding url}" />
                  </ff:CachedImage.GestureRecognizers>
              </ff:CachedImage>
          </DataTemplate>
      </CarouselView.ItemTemplate>
  </CarouselView>

@ibanezjp
Copy link

ibanezjp commented Oct 7, 2024

Same here when running on iOS. Added the source code my project directly and it works. Seems to be an issue with the nuget.

@ichpuchtli
Copy link

Did you add the .UseFFImageLoading() to your MauiProgram ?

@michiel-nwa
Copy link

michiel-nwa commented Oct 22, 2024

Same here after upgrading from 1.2.5 to 1.2.7. I do have .UseFFImageLoading() in MauiProgram.

Still broken though after downgrading to 1.2.5 so I guess the package upgrade process messed up something somewhere. (Eventually fixed with the /bin /obj clearance dance)

@matteocollina
Copy link

Same results of @michiel-nwa :

  • I have UseFFImageLoading() in MauiProgram.cs
  • I've installed the last version of the package: <PackageReference Include="FFImageLoading.Maui" Version="1.2.7" />

But when I use ImageService.Instance is null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants