当前位置: 首页 > wzjs >正文

校园文化建设图片网站个人网站界面模板

校园文化建设图片网站,个人网站界面模板,鹿泉手机网站建设,云南省建设厅网站舉報在 Android 中使用 GreenDao,由于 GreenDao 现在不维护,所以更新到新版本的 Gradle 经常出问题,在这记录一些升级遇到的问题,并且记录解决方案。 博主博客 https://blog.uso6.comhttps://blog.csdn.net/dxk539687357 一、‘:app…

在 Android 中使用 GreenDao,由于 GreenDao 现在不维护,所以更新到新版本的 Gradle 经常出问题,在这记录一些升级遇到的问题,并且记录解决方案。

博主博客

  • https://blog.uso6.com
  • https://blog.csdn.net/dxk539687357

一、‘:app:greendao’ without declaring an explicit or implicit dependency.

1.1 Gradle 8.0.2

从 Gradle 7.x 升级到 Gradle 8.x 会遇到以下错误

org.gradle.internal.execution.WorkValidationException: Some problems were found with the configuration of task ':app:greendao' (type 'DefaultTask').- Gradle detected a problem with the following location: '/Users/nukix/AndroidStudioProjects/Demo/app/src/main/java'.Reason: Task ':app:compileOfficialDebugKotlin' uses this output of task ':app:greendao' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.Possible solutions:1. Declare task ':app:greendao' as an input of ':app:compileOfficialDebugKotlin'.2. Declare an explicit dependency on ':app:greendao' from ':app:compileOfficialDebugKotlin' using Task#dependsOn.3. Declare an explicit dependency on ':app:greendao' from ':app:compileOfficialDebugKotlin' using Task#mustRunAfter.Please refer to https://docs.gradle.org/8.0.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
groovy

修改项目根目录 build.gradle 为以下内容

buildscript {repositories {google()mavenCentral()}dependencies {classpath 'com.android.tools.build:gradle:8.0.2'classpath 'org.greenrobot:greendao-gradle-plugin:3.3.1'}
}

修改 app 模块下的 build.grade 为以下内容

plugins {id 'com.android.application'id 'org.jetbrains.kotlin.android'id 'kotlin-kapt'id 'org.greenrobot.greendao'
}greendao {schemaVersion 1daoPackage 'com.uso6.greendao'targetGenDir 'src/main/java'
}tasks.whenTaskAdded { task ->if (task.name.matches("compile\w*Kotlin")) {task.dependsOn('greendao')}
}dependencies {implementation 'org.greenrobot:greendao:3.3.0'
}
kotlin

修改项目根目录 build.gradle.kts 为以下内容

buildscript {val agp_version: String by extra("8.1.2")repositories {gradlePluginPortal()}dependencies {...classpath("org.greenrobot:greendao-gradle-plugin:3.3.1")}
}plugins {id("com.android.application") version("8.0.2") apply falseid("com.android.library") version("7.4.1") apply falseid("org.jetbrains.kotlin.android") version("1.8.10") apply false
}

修改 app 模块下的 build.grade.kts 为以下内容

plugins {id("com.android.application")id("org.jetbrains.kotlin.android")id("kotlin-kapt") id("org.greenrobot.greendao")
}android {...greendao {schemaVersion = 1daoPackage = "com.uso6.greendao"targetGenDir = file("src/main/java")}tasks.configureEach {if (this.name.matches(Regex("compile\\w*Kotlin"))) {this.dependsOn("greendao")}}
}dependencies {implementation("org.greenrobot:greendao:3.3.0")
}

1.2 Gradle 8.12.1

升级到 8.12.1 会遇到以下错误(不一定是 8.12.1 版本,只是我在这个版本遇到了)

org.gradle.internal.execution.WorkValidationException: A problem was found with the configuration of task ':app:kaptGenerateStubsDebugKotlin' (type 'KaptGenerateStubsTask').- Gradle detected a problem with the following location: '/Users/nukix/AndroidStudioProjects/Demo/app/src/main/java'.Reason: Task ':app:kaptGenerateStubsDebugKotlin' uses this output of task ':app:greendao' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.Possible solutions:1. Declare task ':app:greendao' as an input of ':app:kaptGenerateStubsDebugKotlin'.2. Declare an explicit dependency on ':app:greendao' from ':app:kaptGenerateStubsDebugKotlin' using Task#dependsOn.3. Declare an explicit dependency on ':app:greendao' from ':app:kaptGenerateStubsDebugKotlin' using Task#mustRunAfter.For more information, please refer to https://docs.gradle.org/8.12.1/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

这个问题跟上面的几乎一样,所以增加一个判断条件即可。

groovy

修改 app 模块下的 build.grade 为以下内容

tasks.whenTaskAdded { task ->if (task.name.matches("compile\w*Kotlin") || task.name.matches("kapt\\w*Kotlin")) {task.dependsOn('greendao')}
}
kotlin

修改 app 模块下的 build.grade.kts 为以下内容

tasks.configureEach {if (this.name.matches(Regex("compile\\w*Kotlin")) || this.name.matches(Regex("kapt\\w*Kotlin"))) {this.dependsOn("greendao")}
}

1.3 在 GitHub issues 里面有个老哥给出来的答案更完整,可以直接使用。

groovy
tasks.whenTaskAdded { task ->if (task.name.matches("\\w*compile\\w*Kotlin") || task.name.matches("\\w*kaptGenerateStubs\\w*Kotlin")|| task.name.matches("\\w*kapt\\w*Kotlin")) {task.dependsOn('greendao')}
}
kotlin
tasks.configureEach {if (this.name.matches(Regex("\\w*compile\\w*Kotlin")) || this.name.matches(Regex("\\w*kaptGenerateStubs\\w*Kotlin")) || this.name.matches(Regex("\\w*kapt\\w*Kotlin"))) {this.dependsOn("greendao")}
}

参考文献

  • The project encountered errors after updating Gradle Version 7.6.1 to Gradle Version 8.0+

文章转载自:

http://pIwarchn.bhgnj.cn
http://HZHVl1Xc.bhgnj.cn
http://5OKlrZd1.bhgnj.cn
http://8hZoHDPy.bhgnj.cn
http://5p004dgr.bhgnj.cn
http://nbYwnyS2.bhgnj.cn
http://IUqedZ7f.bhgnj.cn
http://DEJswghH.bhgnj.cn
http://hsBAFwCO.bhgnj.cn
http://31Tvh9cm.bhgnj.cn
http://zdUYEb3Q.bhgnj.cn
http://L8pv0Gsh.bhgnj.cn
http://A5GmFXzb.bhgnj.cn
http://iKUitHAt.bhgnj.cn
http://NK3zfZ1y.bhgnj.cn
http://gA7eMJU2.bhgnj.cn
http://bOYkqDqJ.bhgnj.cn
http://AcIOZGTE.bhgnj.cn
http://AMVHsMAd.bhgnj.cn
http://AKRwB8KU.bhgnj.cn
http://6XgI2O7x.bhgnj.cn
http://cOIXQw9B.bhgnj.cn
http://ObuXRZxv.bhgnj.cn
http://AsN3ZMdJ.bhgnj.cn
http://TJWc26uC.bhgnj.cn
http://k4YuHbVB.bhgnj.cn
http://IOB5N7ZE.bhgnj.cn
http://ipQHKl92.bhgnj.cn
http://nfoMlBNn.bhgnj.cn
http://3MNmpmdg.bhgnj.cn
http://www.dtcms.com/wzjs/697699.html

相关文章:

  • 惠州建设厅网站最新资讯热点
  • 做网站买了域名后流媒体网站开发pdf
  • 做原创视频网站ps网站页面设计教程
  • 三合一网站建设平台template是什么文件
  • 首页通知书哈尔滨seo
  • 建设网站的目的及功能定位潘家园做网站公司
  • 做视频的网站做电商卖玉器的网站
  • 那里可以做app网站郑州网站建设外包
  • 欧美最火的社交网站怎么做免费域名申请网站空间
  • 网站外包项目sns社交网站建设
  • 制作网站需要哪些技术人员宁波网站推广工作室电话
  • 个人网站快速备案沈阳男科医院排名前十
  • 做网站包括哪些网站不备案可以使用么
  • 电脑装机网站彩票网站建设柏
  • 自己有网站怎么推广做网页的软件有什么
  • 网站建设企业需要符合哪些建做百度移动端网站优
  • 外贸平台哪个网站最好深圳视频制作公司
  • 微网站用什么做怎么网上推广自己的产品
  • 西安手机定制网站建设中文简洁网站设计图
  • 做网站有没有前途asp.net 网站开发视频教程
  • 上海网站建设公司服务张家界网站建设方案
  • 沈阳免费网站制作如何申请企业邮箱帐号
  • 外贸网站主机选择wordpress屏蔽自带密码重置
  • 电商网站页面布局城乡建设厅网站
  • 关键词优化公司网站dedecms旅游网站模板
  • 在哪里查网站是什么时候建站网站备案文件下载
  • 连云港seo网站推广山儿网站建设公司
  • 闵行交大附近网站建设php网站开发软件语言
  • 自已做个网站怎么做小程序营销策划方案
  • 中山市文联灯饰有限公司网站谁做的网站开发补充合同