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

4

5

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.

Radicalism answered 21/8, 2016 at 19:7 Comment(1)
I have tried everything. this is the only thing that has worked.Turki
R
-2

Problem Solved

You don't have to turn off the instant run. Simply set

Inside application node in AndroidManifest.xml, uninstall the app before running.

Radicalism answered 2/7, 2017 at 23:5 Comment(1)
what do you mean by that ?Turki
A
8
  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();
Admittedly answered 24/8, 2016 at 15:9 Comment(0)
D
3

plus :increment your AA_DB_VERSION in your manifest. That will force ActiveAndroid regenerate your schema.

Deponent answered 15/11, 2016 at 14:58 Comment(0)
A
1

If you are using gradle 2.0, then add the following line to your AndroidManifest.xml file

<meta-data
    android:name="AA_MODELS"
    android:value="com.myspace.model.modelName"/>

android:value should be the path of your model class.

Abigailabigale answered 6/11, 2018 at 7:13 Comment(0)
R
-2

Problem Solved

You don't have to turn off the instant run. Simply set

Inside application node in AndroidManifest.xml, uninstall the app before running.

Radicalism answered 2/7, 2017 at 23:5 Comment(1)
what do you mean by that ?Turki

© 2022 - 2024 — McMap. All rights reserved.