Closed anarefin closed 9 years ago
You can initialize the PCL Client for iOS with:
IosPclExportClient.Configure();
For Android it would be:
AndroidPclExportClient.Configure()
But it's normally implicitly inferred for Android.
Where I will initialize this IosPclExportClient.Configure(); ?
Once, at the start of your program.
Solved! Thanks a lot!
I have a Xamarin.Forms portable solution, in a class in the PCL project I have this:
protected ServiceStack.JsonServiceClient sc;
in the constructor I have:
sc = new ServiceStack.JsonServiceClient(url);
I run the Android projet and when the execution reaches that code I am getting the error "PclExport.Instance needs to be initialized", what am I missing?
Thanks,
Complete error:
[MonoDroid] UNHANDLED EXCEPTION: [MonoDroid] System.TypeInitializationException: An exception was thrown by the type initializer for ServiceStack.ServiceClientBase ---> System.TypeInitializationException: An exception was thrown by the type initializer for ServiceStack.Text.Env ---> System.ArgumentException: PclExport.Instance needs to be initialized [MonoDroid] at ServiceStack.Text.Env..cctor () [0x00000] in <filename unknown>:0 [MonoDroid] --- End of inner exception stack trace --- [MonoDroid] at ServiceStack.ServiceClientBase..cctor () [0x00000] in