Could not find method greendao() for arguments on project

1k Views Asked by At

While building the project after adding

apply plugin: 'org.greenrobot.greendao'

greendao {
    schemaVersion 2
}

and

compile 'org.greenrobot:greendao:3.2.0'

in dependencies, project is showing error : "Could not find method greendao() for arguments on project "

2

There are 2 best solutions below

0
On BEST ANSWER

Just add the line :

apply plugin: 'org.greenrobot.greendao'

before the line

apply plugin: 'com.android.application'

and project should build.

ex.

apply plugin: 'org.greenrobot.greendao'

apply plugin: 'com.android.application'
0
On

Make sure to add the correct dependencies in correct gradle files, like in root build.gradle and app build.gradle

Add classpath 'org.greenrobot:greendao-gradle-plugin:3.2.1' to root gradle and compile 'org.greenrobot:greendao:3.2.0' to app gradle.