Execution failed for task ':app:buildReleasePreBundle'.
> Sequence contains more than one matching element.
< /code>
Но когда я пытаюсь создать APK, он работает хорошо.
Когда я запускаю Fluther Run, он работает нормально < /p>
Я не знаю, что делать < /p>
В Flutter Doctor All в порядке, я уже пытаюсь удалить сборку, Dart Tool и Executre Fluther Clean. Ненавистные проблемы Gradle, кстати < /p>
Это мой код: < /p>
build.gradle (app) < /h4>
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id "com.google.gms.google-services"
id "com.google.firebase.crashlytics"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
namespace "com.compubac.whiz"
compileSdkVersion 35
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
applicationId "com.compubac.whiz"
minSdkVersion 30
targetSdkVersion 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
splits {
abi {
reset()
enable true
universalApk true
include "armeabi-v7a", "x86", "arm64-v8a"
}
}
/* signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
} */
buildTypes {
release {
signingConfig signingConfigs.debug
/* signingConfig signingConfigs.release */
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}
}
flutter {
source '../..'
}
dependencies {
implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'com.facebook.android:facebook-android-sdk:[5,6)'
implementation 'com.android.support:multidex:2.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test
1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
< /code>
build.gradle (project) < /h4>
allprojects {
repositories {
google()
mavenCentral()
}
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
< /code>
gradle.properties
org.gradle.jvmargs=-Xmx4096mandroid.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
< /code>
settings.gradle
pluginManagement {def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.10.0" apply false
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
id "com.google.gms.google-services" version "4.4.0" apply false
id "com.google.firebase.crashlytics" version "2.9.9" apply false
}
include ":app"
Подробнее здесь: https://stackoverflow.com/questions/796 ... ng-element