android - 配置根项目“android”时出现问题。在锁定文件中发现意外的锁定协议。预期 3,发现 0
问题描述
我最近将我的颤振项目文件夹更改为一个将用于生产的新文件夹,但是在将所有内容重新复制回新文件夹后,我一直收到此错误
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。请问如何解决这个问题,谢谢。另外,如果您需要更多解释或代码,请告诉我
解决方案
这篇文章的一个有用答案错误:在锁定文件中发现意外的锁定协议。预期 3,发现 0
cd path/to/.gradle/
find . -name "*.lock" -delete
推荐阅读
- java - 获取VariableElement的类名和包
- c - 当您动态分配内存时,“指针类型”有什么意义?
- scala - scala中的类型级别模式匹配
- c# - 模拟 Razor 页面单元测试的用户 ClaimsPrincipal
- javascript - Javascript 类作为对象的孩子
- go - 理解gometalinter的警告:conn可以是io.Reader/io.Writer
- ios - Swift 4,Segue 不传递数据
- html - 响应式导航栏 css
- java - 如何在java中获取不同范围内不同概率的随机数?
- android - 将 Firebase 集成的 android 应用推送到 github 是否不安全?