Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attempt to invoke 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.

like image 708
Muazzam A. Avatar asked Aug 21 '16 19:08

Muazzam A.


1 Answers

  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();
like image 91
Pierry Avatar answered Sep 26 '22 15:09

Pierry