配置项目“:cloud_firestore”时出现问题 //已关闭
Posted
技术标签:
【中文标题】配置项目“:cloud_firestore”时出现问题 //已关闭【英文标题】:A problem occurred configuring project ':cloud_firestore' //closed 【发布时间】:2020-06-14 23:06:45 【问题描述】:运行项目时出现这种类型的错误
* What went wrong:
A problem occurred configuring project ':cloud_firestore'.
> Could not open proj remapped class cache for avok974yim47bw7y5uibkvy5o (C:\Users\Lenovo\.gradle\caches\5.6.2\scripts-remapped\build_7tod23iwanax3gvxok38cccwk\avok974yim47bw7y5uibkvy5o\projc2aa9a77c8f22767dac24ce473ea6e20).
> Unexpected lock protocol found in lock file. Expected 3, found 0.
> Failed to notify project evaluation listener.
> Could not get unknown property 'android' for project ':cloud_firestore' of type org.gradle.api.Project.
> Could not find method implementation() for arguments [project ':firebase_core'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
> Could not find method implementation() for arguments [project ':cloud_firestore_web'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* 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 2s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
依赖项
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for ios style icons.
cupertino_icons: ^0.1.2
animated_text_kit: ^2.0.0
firebase_core: ^0.4.4+2
firebase_auth: ^0.15.5+2
cloud_firestore: ^0.13.4
build.gradle
dependencies
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.google.firebase:firebase-analytics:17.2.2'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
这是app gradle的依赖 build.gradle()
dependencies
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
allprojects
repositories
google()
jcenter()
每当我进行颤振运行时,我都会收到此错误,尽管我在制作项目时输入了所有依赖项
【问题讨论】:
通过删除位于.gradle\caches\5.6.2\scripts-remapped\build_7tod23iwanax3gvxok38cccwk\avok974yim47bw7y5uibkvy5o\projc2aa9a77c8f22767dac24ce473ea6e20
的文件夹我解决了这个错误
【参考方案1】:
我删除了所有
firebase_core: ^0.4.4+2
firebase_auth: ^0.15.5+2
cloud_firestore: ^0.13.4
然后一一添加
喜欢
添加firebase_core: ^0.4.4+2
然后运行应用程序
添加firebase_auth: ^0.15.5+2
并运行应用程序
它有效,我不知道问题出在哪里,但我用它解决了。
【讨论】:
以上是关于配置项目“:cloud_firestore”时出现问题 //已关闭的主要内容,如果未能解决你的问题,请参考以下文章
如何解决“由于上述问题,无法构建插件 cloud_firestore。”
评估根项目“android”时出现问题。配置项目 ':app' 时出现问题
构建失败'配置项目':react-native-reanimated'时出现问题。在 React 原生项目中