The new project builds by referring to greenDAO. Since the 3.2.2 version was used before, the build project always reported errors. After consulting the materials, it was found that the problem was caused by the package introduction method and package version.
Attached greenDAO official address: greenrobot.org/greendao/
When developing, pay attention to the dependency package version, so that version problems do not affect the development progress
1. Add a dependency
Open the File = > Project Structure = > Dependencies = > app, point the plus sign on the right, select the library dependency, input org. Greenrobot: greendao: 3.3.0, Click the Search button to find GreenDAO’s Library. When you find it, click the OK button below to add dependencies. As shown in figure:
2. The configuration
Build. Gradle (:app) add the following code: ‘. Org. Greenrobot greendao 2.1.2 greendao {1 daoPackage schemaVersion ‘com. Haxxj. Greendao. Greendao’ targetGenDir ‘src/main/java’ }
Classpath ‘org.greenrobot:greendao-gradle-plugin:3.3.0’
Use 3.
Open Build => Make Project
Build
Success, problem solved smoothly.