我正在尝试添加 firebase 依赖项。当我跑步时flutter run
I get
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher.
The following dependencies do not satisfy the required version:
project ':google_api_availability' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71
Pubscec.yaml
dependencies:
flutter:
sdk: flutter
firebase_auth: ^0.8.1
google_sign_in: ^4.0.1
cloud_firestore: ^0.9.0+1
firebase_core: ^0.3.0+1
firebase_storage: ^2.0.1
cupertino_icons: ^0.1.2
font_awesome_flutter: ^8.0.1
country_code_picker: ^1.1.0
fluttertoast: ^2.0.7
image_picker: ^0.4.6
shared_preferences: ^0.4.2
cached_network_image: ^0.4.1
intl: ^0.15.7
geolocator: ^2.1.1
http: ^0.11.3+14
flutter_google_places: ^0.1.4+1
location: ^1.1.6
uuid: ^1.0.3
auto_size_text: 0.3.0
构建.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.google.gms:google-services:4.2.0'
}
}
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
}
应用程序/build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.myapp"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services' // Gradle plugin
可以找到依赖哪个包google_api_availability
通过跑步flutter packages pub deps
在项目的根目录上 - 这将在树视图中列出项目的所有直接和传递依赖项。
我找不到显示包的插件依赖项的方法 - 我猜你只有在尝试构建它时才会发现。
问题是你使用的版本3.3.1
Android Gradle 插件的一部分,它强制执行 Kotlin1.3.0
或以上。与此同时,geolocator
包取决于google_api_availability
,似乎正在使用 Kotlin1.2.71
。目前还没有版本google_api_availability
使用 Kotlin1.3.0
或以上,所以你只有 1 个解决方案 - 将 Android Gradle 插件降级到版本3.2.1
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)