Start a new topic

Can`t connect to a kinvey collection

So, I have a collection named "cars" on Kinvey backend. And I can`t connect to it from my Xamarin.Android Kinvey project code. It's throwing NullReference Exception: Object instance not set to an instance of the object.


my collection on the backend


image



here is my entity in cs

using Newtonsoft.Json;
using Kinvey;

namespace DaysTaxi.Droid
{
    [JsonObject(MemberSerialization.OptIn)]
    public class Car : Entity
    {
        public Car() { }

        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("photo_id")]
        public string PhotoID { get; set; }

        [JsonProperty("class_id")]
        public int Class { get; set; }

        [JsonProperty("_kmd")]
        public KinveyMetaData Meta { get; set; }

        
        [JsonProperty("_acl")]
        public KinveyMetaData acl { get; set; }

        [JsonProperty("_id")]
        public int id { get; set; }

    }
}

 


here is my code

 

 DataStore<Car> cars = DataStore<Car>.Collection("cars", DataStoreType.SYNC);

 and on this line appears a  NullReference Exception


Can anyone help, please? What can be a reason of the problem?

And yes, sorry for my English.


Pranav J,


Thank you, but i have seen it before and hadn`t found an answer there.

When i built it, it was working  and i could save/fetch data successfully.

Jacek,

Please take a look at our sample app and see if it helps:
http://devcenter.kinvey.com/xamarin/samples#

 

Thanks,

Pranav

Kinvey

Login or Signup to post a comment