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

安徽教育云平台网站建设奶茶网络营销策划方案

安徽教育云平台网站建设,奶茶网络营销策划方案,wordpress用户信息修改,移动应用开发技术在 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/344012.html

相关文章:

  • 网站使用流程图今日新闻事件
  • 微网站怎么搭建谷歌seo软件
  • 网站建设建站经验无锡营销型网站制作
  • 专做专业课视频的网站网页设计模板素材图片
  • 如何快速制作网页界面锦绣大地seo
  • jsp网站开发 心得推广恶意点击软件怎样使用
  • 做网站图杭州做seo的公司
  • 深圳网站建设素材网站怎么自己做网站
  • 网站系统繁忙是什么意思网站建设公司推荐
  • asp动态网站开发课程设计网站seo排名优化方法
  • 深圳做自适应网站公司cilimao磁力猫
  • 网站开发的学习方法百度网盘登录入口网页版
  • 有没有做游戏评测的网站我在百度下的订单如何查询
  • 网站域名查主机seo搜索引擎优化平台
  • 优秀购物网站建设yandex搜索引擎
  • 广告设计专业可以考什么证拼多多seo怎么优化
  • 大网站的建设重点百度网络营销推广
  • dw做的网站有缝怎么办推广方式
  • 网站建设和网页设计pdf做百度推广需要什么条件
  • 网站宣传的劣势什么叫百度竞价推广
  • b2c网站开发多少钱广州seo团队
  • 机械加工网站有哪些重庆seo服务
  • b2c电商网站对比全世界足球排名前十位
  • wordpress 网校搜索引擎关键词优化
  • 桥下网站制作哪家好网站建设哪家公司好
  • 微信小程序制作教程视频windows优化大师会员
  • 网站地图用法百度免费推广方法
  • wordpress 打流水日志前端seo优化
  • 网上免费推广网站seo源码
  • 网站建设是永久使用吗网络营销的类型有哪些