我正在使用 Visual Code 构建一个 flutter 应用程序,该应用程序的版本 1 运行良好,包括使用 Flutter build apk 构建和签署我的 APK。
然后我引入了 firebase 和 Firecore,完成应用程序后...我无法再构建我的 APK。我强烈怀疑我在我的 gradle 文件中做错了事情。但我只是不够聪明,无法找出什么。已经搜索了无数个小时,但还没有成功。
希望大家能帮帮我。
我多次尝试调整我的 gradle 文件,但还没有成功
我感谢您的帮助和解释。
我会将我的gradle文件放在错误下
当我尝试使用
检查 gradle 时出现最新错误gradle build --scan --warning-mode all
https://gradle.com/s/jt6ihjarbqzr4
执行 org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction > C 时发生故障
项目级别
buildscript {
ext.kotlin_version = '1.9.23'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.6'
classpath 'com.google.gms:google-services:4.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id 'com.android.application' version '8.3.1' apply false
id 'com.google.gms.google-services' version '4.4.1' apply false
}
repositories {
google()
mavenCentral()
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
应用级别
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
id 'kotlin-android'
}
android {
namespace "com.berksport_app"
compileSdkVersion 33
defaultConfig {
minSdkVersion 21
targetSdkVersion 32
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation(platform("com.google.firebase:firebase-bom:32.8.0"))
implementation 'androidx.appcompat:appcompat-resources:1.6.1'
implementation("com.google.firebase:firebase-auth")
implementation("com.google.firebase:firebase-firestore")
implementation 'com.google.firebase:firebase-crashlytics-buildtools:2.9.9'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
目标SdkVersion 33
覆盖你的开发依赖
依赖覆盖: firebase_core:^2.4.1
重新构建您的项目 扑干净 扑扑酒吧得到
另一种解决方法
flutter pub 升级--主要版本
稍后谢谢我......