Flutter 同步代码循环问题修复
约 93 字小于 1 分钟
Flutter
2023-08-06
同步代码循环 或者 Could not create task ':generateLockfiles'.
修改flutter.gradle(flutter/packages/flutter_tools/gradle/flutter.gradle)文件 flutter_2.8.1 及以下才需要, flutter_2.10.5+ 官方修复了
if (isFlutterAppProject()) { // 👈
rootProject.tasks.register('generateLockfiles') {
rootProject.subprojects.each { subproject ->
def gradlew = (OperatingSystem.current().isWindows()) ?
"${rootProject.projectDir}/gradlew.bat" : "${rootProject.projectDir}/gradlew"
rootProject.exec {
workingDir rootProject.projectDir
executable gradlew
args ":${subproject.name}:dependencies", "--write-locks"
}
}
}
} // 👈