greendao3出现 Error:Execution failed for task ':app:greendao'.

本文章转载自:http://blog.csdn.net/huangxiaoguo1/article/details/70318403

greendao编译不通过,出现下面错误:

Error:Execution failed for task ':app:greendao'.
> org.eclipse.jdt.internal.compiler.impl.CompilerOptions.versionToJdkLevel(Ljava/lang/Object;)J
  • 之前我们配置greendao在app下的build.grdle中,如下:
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'org.greenrobot:greendao-gradle-plugin:3.2.0'
    }
}
apply plugin: 'org.greenrobot.greendao'

greendao {
    //数据库的schema版本,也可以理解为数据库版本号
    schemaVersion 1
    //设置DaoMaster、DaoSession、Dao包名,也就是要放置这些类的包的全路径。
    daoPackage 'cn.hnshangyu.testgreendao.greendao'
    //设置DaoMaster、DaoSession、Dao目录
    targetGenDir 'src/main/java'
}
dependencies {
    compile 'org.greenrobot:greendao:3.2.0'
}
  • 这里我们需要更改他的配置:

在app下的build.grdle中,如下:


apply plugin: 'org.greenrobot.greendao'

greendao {
    //数据库的schema版本,也可以理解为数据库版本号
    schemaVersion 1
    //设置DaoMaster、DaoSession、Dao包名,也就是要放置这些类的包的全路径。
    daoPackage 'cn.hnshangyu.testgreendao.greendao'
    //设置DaoMaster、DaoSession、Dao目录
    targetGenDir 'src/main/java'
}
dependencies {
    compile 'org.greenrobot:greendao:3.2.0'
}

在工程的build.grdle中,如下:


buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.1'
        classpath 'org.greenrobot:greendao-gradle-plugin:3.2.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

这样就可以了。。。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值