Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

DependencyService does not work with iOS

$
0
0

Hello

I use DependencyService to access platform specific features from a PCL library with Xamarin Forms.

It works perfectly with Android and Windows Phone devices, but crashes on the dependency resolution with iOS:
DependencyService.Get()

I did not forget the dependence injection line
[assembly: Xamarin.Forms.Dependency (typeof (classImplementation))]

Again, it works fine with other OS. I read on another thread that it might be the compiler that removes the implementation from the package as it is not used, so I tried to instanciate the implementation in the iOS project just to force the compiler keep the code. It does not help, the dependency resolution still fails.

Is it a known bug from xamarin?? Do you have any suggestions?

I'm using the latest versions of xamarin / xamarin.forms.

Best

Adrien


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>