Search code examples
c#androidparse-platformxamarin.formsportable-class-library

Xamarin Forms Parse SDK Null Ref


I am trying to use Xamarin Forms PCL with Parse. I have installed the Parse Component to the Android project. I have a parse server running on localhost which I have successfully tested and added a user to. Although everything seems to be set up correctly any Parse API I try to call I get a null reference exception. My code is below:

ParseClient.Configuration config = new ParseClient.Configuration
{
    ApplicationId = "my-app-id",
    Server = "http://localhost:1337/parse/"
};
ParseClient.Initialize(config);

var user = await ParseUser.LogInAsync("steve", "abc123");
Console.WriteLine("Got User {0}.", user.Username);

I get a null reference when calling LogInAsync. If anyone has any experience or advice it would be greatly appreciated. Thanks!


Solution

  • localhost will point back to your Android emulator/device. You need to use the IP or FQDN of your local server – Jason 18 mins ago