ОШИБКА: сборка не удалась из-за исключения.
- Что пошло не так:
Не удалось выполнить задачу «:app:mergeReleaseJavaResource».
com.google.common.base.VerifyException (нет сообщения об ошибке)
android/build.gradle< /p>
buildscript {
ext.kotlin_version = '1.8.21' // หรือเวอร์ชันที่สอดคล้องกัน
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.2' // อัปเดตเวอร์ชันของ Android Gradle Plugin
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
android/app/build.gradle
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}
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 {
compileSdkVersion 34
namespace = "com.example.myapp"
compileSdk = 34
ndkVersion = "21.4.7075529"
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
defaultConfig {
applicationId = "com.example.myapp"
minSdk = 21
targetSdk = 34
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
multiDexEnabled true
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
packagingOptions {
pickFirst 'META-INF/LICENSE'
pickFirst 'META-INF/LICENSE.txt'
pickFirst 'META-INF/NOTICE'
pickFirst 'META-INF/NOTICE.txt'
pickFirst 'META-INF/DEPENDENCIES'
pickFirst 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
kotlinOptions {
jvmTarget = "17"
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.debug
signingConfig signingConfigs.release
}
debug {
minifyEnabled false
shrinkResources false
}
}
}
flutter {
source = "../.."
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.google.guava:guava:31.1-android'
// เพิ่ม dependencies อื่น ๆ ที่ใช้ในโปรเจกต์ของคุณ
}
Подробнее здесь: https://stackoverflow.com/questions/787 ... varesource