I'm using the greenDAO for Android and I want to edit the greenDAO generator, because it overwrites @SerializedName which I need for GSON every time I change something on my database.
So I was adding greenDAO from https://github.com/greenrobot/greenDAO to my Android Studio project by File -> New -> Import Module... and just selected the GreenDaoGenerator-module.
Next, I build my java module to generate the greenDAO database, which uses the GreenDaoGenerator-module as dependency and I get an exception that the template dao.ftl was not found.
Can someone please help me? I'm new to Android and do not check, why it doesn't find the file.
Exception in thread "main" java.io.FileNotFoundException: Template "dao.ftl" not found.
The problem is change in path of the template files. While I am not sure how to set the path to something relative, here is a hack that works. Open DaoGenerator.java. In the constructor, replace
config.setDirectoryForTemplateLoading(new File("<your absolute path to templates>"));
You will need to find where the actual templates are stored. For me they were in