【发布时间】:2020-07-22 07:36:23
【问题描述】:
我有一个 build.gradle,之前添加但后来替换了一个依赖项:
dependencies {
...
// I WANT THIS
implementation fileTree(dir: 'new_project/android/src/main', include: ['*.jar'])
// I dont want this
// implementation fileTree(dir: 'old_project/android/src/main', include: ['*.jar'])
}
但是 Gradle(使用 6.1.1)已经缓存了旧的依赖项并且不想用我的新依赖项替换它(即使在同步和重新导入 gradle 项目之后),即使它找不到旧的依赖项(我删除了 old_project),所以它给了我一个
Cause: assert pluginDirectory.exists()
| |
| false
old_project/android
我什至在任何项目代码中都找不到这个assert 代码,所以我不知道该怎么办。
我也尝试从项目设置中删除该模块,但当我按下“设置”窗口的“应用”或“确定”时,Android Studio 重新添加了它。
我正在尝试使用修改后的flutter存储库,old_project实际上是/usr/local/flutter/.pub-cache/hosted/pub.dartlang.org/camera-0.5.8+2,而新项目是我创建的repo(从github克隆项目)。
事实证明,Flutter 正在读取它最初创建的文件:
def moduleProjectRoot = project(':flutter').projectDir.parentFile.parentFile
def pluginsFile = new File(moduleProjectRoot, '.flutter-plugins-dependencies')
【问题讨论】: