getting below building code error with Realm
: app: compileDebugJavaWithJavac Note: processing class Error DataBaseQuestion: a public default constructor with no arguments should be declared if a custom constructor is declared. Note. Creating DefaultRealmModule Warning: File for type 'io.realm.DefaultRealmModule' created in the last round is not subject to annotation processing. Warning: a file for the type 'io.realm.DefaultRealmModuleMediator' created in the last round will not be subject to annotation processing. 2 warnings Error: execution failed for task ': app: compileDebugJavaWithJavac'.
Compilation error; see compiler error output for details.
Note. The default constructor is already present in the Model or Java Bean class.
Can someone please help me how to solve this?
DataBaseQuestion.java
public class DataBaseQuestion extends RealmObject{ int id; String Question =null; String QuestionNo =null; List<String> optionList=null; String typeOfQuestion=null; String Answer = null; String Explanation = null; DataBaseQuestion() { } public DataBaseQuestion(int id, String question, String questionNo, List<String> optionList, String typeOfQuestion, String answer, String explanation) { this.id = id; Question = question; QuestionNo = questionNo; this.optionList = optionList; this.typeOfQuestion = typeOfQuestion; Answer = answer; Explanation = explanation; } public String getQuestion() { return Question; } public void setQuestion(String question) { Question = question; } public String getQuestionNo() { return QuestionNo; } public void setQuestionNo(String questionNo) { QuestionNo = questionNo; } public List<String> getOptions() { return optionList; } public void setOptions(List<String> optionList) { this.optionList = optionList; } public String getTypeOfQuestion() { return typeOfQuestion; } public void setTypeOfQuestion(String typeOfQuestion) { this.typeOfQuestion = typeOfQuestion; } public String getAnswer() { return Answer; } public void setAnswer(String answer) { Answer = answer; } public String getExplanation() { return Explanation; } public void setExplanation(String explanation) { Explanation = explanation; } @Override public String toString() { return "DataBaseQuestion{" + "Question='" + Question + '\'' + ", QuestionNo='" + QuestionNo + '\'' + ", options=" + optionList + ", typeOfQuestion='" + typeOfQuestion + '\'' + ", Answer='" + Answer + '\'' + ", Explanation='" + Explanation + '\'' + '}'; }
java android realm
Bat
source share