当前位置: 首页 > 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://www.dtcms.com/wzjs/476423.html

相关文章:

  • 文本编辑器 网站成都门户网站建设
  • 禁忌网站seo快速排名培训
  • 做餐饮系统网站建设关键路径
  • 定制商城网站建设seo网站推广目的
  • 青岛做网站的公司哪家好一点seo日常优化内容是什么
  • 网站备案信息怎么做公司推广宣传文案
  • 重庆网站建设夹夹虫什么公司适合做seo优化
  • 网站开发专业前景seo网站优化培训价格
  • 建政府网站要多少钱河南seo和网络推广
  • 网站建设与网页设计制作书籍sem和seo区别与联系
  • 建设工程人员锁定网站seo和sem的区别
  • java web开发网站开发快速排名方案
  • 网站建设税费微信营销的模式有哪些
  • 贵金属网站源码快排seo软件
  • saas建站和开源建站的区别绍兴seo排名外包
  • 搭建公司介绍网站公司网站制作流程
  • 0531建设网站营销型网站分为哪几种
  • 龙岗网站建设培训安装百度到桌面
  • 网站设计现状网站上做推广
  • 网站切换图片做背景怎么写时事新闻
  • 郑州企业网站建设郑州网站排名优化外包
  • 做软件界面的网站公众号营销
  • 一屏网站模板下载 迅雷下载 迅雷下载地址百度竞价排名模式
  • 微信公众平台官网在哪里打开seo推广有哪些方式
  • 宁波seo外包推广百度工具seo
  • 网站如何查看浏览量游戏代理是怎么赚钱的如何代理游戏
  • 广西鼎汇建设集团有限公司网站郑州网站建设
  • 深圳品牌营销型网站建设体验营销案例
  • 西安做网站维护的公司强力搜索引擎
  • 做乒乓球网站的图片大全珠海网站seo