Search code examples
androidactiveandroid

java.lang.NullPointerException at com.activeandroid.Model.<init>(Model.java:53)


I'm trying to add a new table with ActiveAndroid and I'm getting:.

java.lang.NullPointerException
    at com.activeandroid.Model.<init>(Model.java:53)

on:

public Model() {
        this.idName = this.mTableInfo.getIdName();
    }

As I understand from the documentation that I don't need a migration for new table so I created only the class that extends Model class with all needed annotation.

How do I add this new table right?


Solution

  • if you have mentioned the models using like these

      <meta-data
            android:name="AA_MODELS"
            android:value="models.objectModel.UserModel,
            models.objectModel.TestsModel,models.objectModel.AllergyModel" />
    

    then make sure that the new model is also specified here , i got the same problem and solved it by adding new model to this list ..