Xamarin DependencyService: System.MissingMethodException: Default constructor not found for [Interface]
Maybe you can try making your interface implementation classes public
, your constructors are visible, but the class itself might not be.
So Like:
[assembly: Xamarin.Forms.Dependency(typeof(PaymentProcessor_Android))]
namespace Enchantum.Droid.Functions_Android
{
public class PaymentProcessor_Android : PaymentProcessor //make the class public
{
//your code here
}
}
In my case, the problem was in the assembly exportation line.
The app was crashing as I used interface type instead of the class implementation:
[assembly: Xamarin.Forms.Dependency(typeof(IServiceType))]
But the correct way is to use Platform-Specific implementation of the interface:
[assembly: Xamarin.Forms.Dependency(typeof(ServiceImplementation_Android))]
I have the same issue for Linker , When I set Linker to None its working