你好,我是初学者,还不明白 gradle 如何在 flutter 上工作。上次代码运行时一切正常,但当我重新运行它时,发生了 gradle 错误。无论如何,我不更改任何 gradle 文件,我所做的只是修改我的 dart 文件并在 pubspec.yaml 中添加一些插件
谢谢
我做过的事情:
flutter 干净
Launching lib/main.dart on LUNA V55 in debug mode...
Initializing gradle... 7.9s
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "/Users/ngademint/Documents/firecek/firecek_mobile_backoffice/android/gradlew" exited abnormally:
> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
> Task :app:properties
------------------------------------------------------------
Project :app
------------------------------------------------------------
INTERNAL__CHECKED_MINIMUM_PLUGIN_VERSIONS: true
allprojects: [project ':app']
android: com.android.build.gradle.internal.dsl.BaseAppModuleExtension_Decorated@69b7e7dc
androidDependencies: task ':app:androidDependencies'
ant: org.gradle.api.internal.project.DefaultAntBuilder@1dded2de
antBuilderFactory: org.gradle.api.internal.project.DefaultAntBuilderFactory@5e62e49c
archivesBaseName: app
artifacts: validateSigningProfile: task ':app:validateSigningProfile'
validateSigningRelease: task ':app:validateSigningRelease'
version: unspecified
writeDebugApplicationId: task ':app:writeDebugApplicationId'
writeProfileApplicationId: task ':app:writeProfileApplicationId'
writeReleaseApplicationId: task ':app:writeReleaseApplicationId'
1 actionable task: 1 executed
FAILURE: Build failed with an exception.
* What went wrong:
Could not update time stamp for /Users/ngademint/Documents/firecek/firecek_mobile_backoffice/android/.gradle/4.10.2/gc.properties
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full
insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Command: /Users/ngademint/Documents/firecek/firecek_mobile_backoffice/android/gradlew app:properties
Please review your Gradle project setup in the android/ folder.```
最佳答案
嗯,我只是通过删除 <project>/android/.gradle/4.10.2/
中的 gc.properties 来解决它然后重新运行它。工作起来就像一个魅力
关于Flutter 无法更新 gc.properties 的时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57158660/