【问题标题】:A problem occurred configuring root project 'android'. Unexpected lock protocol found in lock file. Expected 3, found 0配置根项目“android”时出现问题。在锁定文件中发现意外的锁定协议。预期 3,发现 0
【发布时间】:2023-03-22 18:00:01
【问题描述】:

我最近将我的颤振项目文件夹更改为将用于生产的新文件夹,但在将所有内容重新复制回新文件夹后,我一直收到此错误

Launching lib\main.dart on Samsung Galaxy S10 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository().
      > Unexpected lock protocol found in lock file. Expected 3, found 0.

* 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 2m 24s
Exception: Gradle task assembleDebug failed with exit code 1

我已经按照其他方式来解决,例如有人在stack-overflow 中所说的。我还从缓存中删除了 gradle 重新启动我的应用程序仍然显示此错误

一些 build.gradle 文件可以在这里找到github。请问如何解决这个问题,谢谢。另外,如果您需要更多解释或代码,请告诉我

【问题讨论】:

    标签: android flutter dart gradle


    【解决方案1】:

    这篇文章的有用答案Error:Unexpected lock protocol found in lock file. Expected 3, found 0

    cd path/to/.gradle/
    find . -name "*.lock" -delete 
    

    【讨论】:

      猜你喜欢
      • 2017-08-28
      • 1970-01-01
      • 2017-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-20
      • 2021-04-09
      • 2020-06-28
      相关资源
      最近更新 更多