简体   繁体   中英

Could not find method greendao() for arguments on project

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 "

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.

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'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM