我刚刚升级到Dart 2和最新版本的Flutter,现在我的应用程序无法构建。我在互联网上搜索过,但仍然不明白为什么会出现这种情况。
我收到的错误信息是:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Android dependency 'com.android.support:support-v4' has different version for the compile (26.1.0) and runtime (27.1.0) classpath. You should manually set the same version via DependencyResolution
项目 build.gradle 文件:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
pubspec.yaml:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
google_sign_in: ^3.0.2
firebase_auth: ^0.5.5
firebase_database: ^0.4.5
firebase_core: ^0.2.3
flutter_blue: ^0.3.3
dev_dependencies:
flutter_test:
sdk: flutter
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
我已经将我的软件包更新到最新版本,并且正在运行最新版本的Dart和Flutter。
我真的不明白是什么原因导致了这个错误。
有人可以帮忙吗?