英文:
> Could not create task ':flutter_plugin_android_lifecycle:testReleaseUnitTest'. > this and base files have different roots:
问题
尽管我已从本地磁盘 D 中删除了 flutter_plugin_android_lifecycle,但仍然显示此错误 -> 无法确定任务 ':flutter_plugin_android_lifecycle:test' 的依赖关系。 > 无法创建任务 ':flutter_plugin_android_lifecycle:testReleaseUnitTest'。 > 此文件和基本文件具有不同的根目录:D:\book_store\build\flutter_plugin_android_lifecycle 和 C:\Users\dell\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_plugin_android_lifecycle-2.0.15\android。
我已尝试过
flutter clean
flutter pub get
在根目录中。
英文:
Even though I have deleted flutter_plugin_android_lifecycle from local disk d but still it is showing this error ->
Could not determine the dependencies of task ':flutter_plugin_android_lifecycle:test'.
> Could not create task ':flutter_plugin_android_lifecycle:testReleaseUnitTest'.
> this and base files have different roots: D:\book_store\build\flutter_plugin_android_lifecycle and C:\Users\dell\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_plugin_android_lifecycle-2.0.15\android.
I have tried
flutter clean
flutter pub get
in root directories
答案1
得分: 0
我认为你需要升级Gradle版本。
dependencies {
classpath 'com.android.tools.build:gradle:8.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
英文:
I think you have to upgrade the Gradle version.
dependencies {
classpath 'com.android.tools.build:gradle:8.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论