Try invoking the virtual method 'java.lang.String com.activeandroid.TableInfo.getIdName ()' on a null object reference


i am getting this Error

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.activeandroid.TableInfo.getIdName()' on a null object reference

when i disable Instant Run i did not get any error my project works fine.

But i want to keep instant Run Enabled. I find some where that if i want to enabled Instant Run i have to un-check the

ReStart the Activity on code changes

but this did not work for me.

Any solution for this is highly appreciated.

  1. Verify your androidManifest, and add:

    <application... > <meta-data android:name="AA_MODELS" android:value="myfullpackage.myentity1, myfullpackage.myentity2 " />

  2. Verify if your class extends to Model and has constructor with super();