Android 颤振问题云firestore依赖性
我有一个Flatter应用程序运行良好,但当我添加云firestore依赖项时,它会崩溃:Android 颤振问题云firestore依赖性,android,flutter,google-cloud-firestore,Android,Flutter,Google Cloud Firestore,我有一个Flatter应用程序运行良好,但当我添加云firestore依赖项时,它会崩溃: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:preDebugBuild'. Android dependency 'android.arch.lifecycle:runtime' has different version for the compile (1.0.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:preDebugBuild'.
Android dependency 'android.arch.lifecycle:runtime' has different version for the compile (1.0.0) and runtime (1.1.1) classpath. You should manually set the same version via DependencyResolution
这是我的pubspec.yaml
dependencies:
flutter:
sdk: flutter
#FIRESTORE
cloud_firestore: ^0.9.0
我怎样才能解决这个问题
就我而言,迭戈发生这种情况是因为依赖关系相互冲突。只需将您的cloud\u firestore降级到较旧版本,即将cloud\u firestore:^0.9.0替换为cloud\u firestore:^0.8.2+1或任何较旧版本似乎我需要的配置比添加cloud\u firestore依赖项更多。我已经学习了这个教程 作为总结: 我必须将cloud\u firestore:^0.9.0更改为cloud\u firestore:^0.8.2+3 Pubspec.yaml:
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
#FIRESTORE
cloud_firestore: ^0.8.2+3
.android/app/build.gradle:
dependencies {
...
classpath 'com.google.gms:google-services:4.2.0'
}
...
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "26.1.0"
}
}
}
}
apply plugin: 'com.google.gms.google-services'
android {
defaultConfig {
...
multiDexEnabled true
}
}
在浪费了很多时间之后,我刚刚开始为自己工作: 公开发行 firebase_认证:^0.6.6 谷歌登录:^3.2.4 firebase_核心:^0.2.5+1 云存储:^0.8.2+3 app\build.gradle 第21版(WAS16版) 并且没有添加任何依赖项{ } projectbuild.gradle
“com.google.gms:googleservices:4.0.1”(不是上面为尼格斯工作的4.2.0)仍然存在同样的问题。。。我也尝试过^0.8.1+1,结果是一样的…这应该可以解决问题。。。将以下配置添加到android/app/build.gradle configurations.all{resolutionStrategy.force'com.android.support:support compat:27.1.1'resolutionStrategy.force'com.android.support:appcompat-v7:27.1.1'resolutionStrategy.force'com.android.support:support-v4:27.1.1'}我不得不添加更多的配置来实现这一点。检查我的答案