I have a simple class named A which has two private fields.
public class A {
private String a;
private String b;
} // A
When I get all declared fields from class instance, I get one extra field named $change of type com.android.tools.fd.runtime.IncrementalChange
. Where is it coming from ? I am totally not getting this.
Field[] fields = cls.getDeclaredFields();
for (int i = 0, len = fields.length; i < len; i++) {
Field field = fields[i];
field.setAccessible(true);
Log.d("TAG", field.getName());
if (field.isAnnotationPresent(Primary.class)) {
query += getFromalName(field.getName()).toUpperCase() + " " + getSchemaType(field.getType().getSimpleName()) + " PRIMARY KEY, ";
continue;
}
if (field.isAnnotationPresent(NotNull.class)) {
query += getFromalName(field.getName()) + " " + getSchemaType(field.getType().getSimpleName()) + " NOT NULL, ";
continue;
}
query += getFromalName(field.getName()) + " " + getSchemaType(field.getType().getSimpleName()) + ", ";
} // end for
query = query.substring(0, query.lastIndexOf(","));
query += " )";
It was added to support instant run. Disabling instant run solved the problem. here
is the link to android issue tracker
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With