Android [ksp] java.lang.NoSuchMethodError: 'com.google.common.collect.ImmutableMap com.google.common.collect.ImmutableMaJAVA

Программисты JAVA общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Android [ksp] java.lang.NoSuchMethodError: 'com.google.common.collect.ImmutableMap com.google.common.collect.ImmutableMa

Сообщение Anonymous »

Я обновляю библиотеки до последней версии и включаю jvm до 17, но до сих пор проблема заключалась в том, что [ksp] java.lang.NoSuchMethodError: 'com.google.common.collect.ImmutableMap com.google.common.collect .ImmutableMap$Builder.buildOrThrow()'
Я уже просмотрел веб-сайт и сказал, что, возможно, там используется старая версия гуавы, поэтому я пытаюсь реализовать(" com.google.guava:guava:33.3.1-android") в моем Gradle и все еще не работает
я не могу найти, какие библиотеки используют guava, попробуйте обновить библиотеки до последней версии и гуава тоже, но проблема все та же, я даю вам gradle.kts
app Gradle kts
import org.jetbrains.kotlin.konan.properties.Properties

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("io.realm.kotlin")
id("com.google.devtools.ksp")
id("com.google.dagger.hilt.android")
id("kotlin-parcelize")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
}

val props = Properties()
file("../local.properties").inputStream().use { props.load(it) }

android {
namespace = "com.honcho.quickfire"
compileSdk = 34

signingConfigs {
getByName("debug") {
keyAlias = props.getProperty("debug.key.alias")
keyPassword = props.getProperty("debug.key.password")
storeFile = file(props.getProperty("debug.key.path"))
storePassword = props.getProperty("debug.key.password.store")
}
create("release") {
keyAlias = props.getProperty("release.key.alias")
keyPassword = props.getProperty("release.key.password")
storeFile = file(props.getProperty("release.key.path"))
storePassword = props.getProperty("release.key.password.store")
}
create("beta") {
keyAlias = props.getProperty("release.key.alias")
keyPassword = props.getProperty("release.key.password")
storeFile = file(props.getProperty("release.key.path"))
storePassword = props.getProperty("release.key.password.store")
}
}

defaultConfig {
applicationId = "com.honcho.quickfire"
minSdk = 23
targetSdk = 34
versionCode = 81
versionName = "2.0.24"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}

buildTypes {
release {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
buildConfigField("String", "HOST", props.getProperty("RELEASE_HOST_API"))
buildConfigField("String", "GALLERY_HOST", props.getProperty("RELEASE_GALLERY_HOST"))
buildConfigField("String", "WEB_HOST", props.getProperty("RELEASE_WEB_HOST"))
buildConfigField("String", "SOCKET_HOST", props.getProperty("RELEASE_SOCKET_HOST"))
buildConfigField("String", "MIXPANEL_TOKEN", props.getProperty("MIXPANEL_TOKEN"))
buildConfigField("String", "DATADOG_TOKEN", props.getProperty("DATADOG_TOKEN"))
signingConfig = signingConfigs.getByName("release")
}

debug {
applicationIdSuffix = ".debug"
isDebuggable = true
buildConfigField("String", "HOST", props.getProperty("DEBUG_HOST_API"))
buildConfigField("String", "GALLERY_HOST", props.getProperty("DEBUG_GALLERY_HOST"))
buildConfigField("String", "WEB_HOST", props.getProperty("DEBUG_WEB_HOST"))
buildConfigField("String", "SOCKET_HOST", props.getProperty("DEBUG_SOCKET_HOST"))
buildConfigField("String", "MIXPANEL_TOKEN", props.getProperty("MIXPANEL_TOKEN"))
buildConfigField("String", "DATADOG_TOKEN", props.getProperty("DATADOG_TOKEN"))
}

create("beta") {
applicationIdSuffix = ".beta"
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
buildConfigField("String", "HOST", props.getProperty("RELEASE_HOST_API"))
buildConfigField("String", "GALLERY_HOST", props.getProperty("RELEASE_GALLERY_HOST"))
buildConfigField("String", "WEB_HOST", props.getProperty("RELEASE_WEB_HOST"))
buildConfigField("String", "SOCKET_HOST", props.getProperty("RELEASE_SOCKET_HOST"))
buildConfigField("String", "MIXPANEL_TOKEN", props.getProperty("MIXPANEL_TOKEN"))
buildConfigField("String", "DATADOG_TOKEN", props.getProperty("DATADOG_TOKEN"))
}
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
compose = true
buildConfig = true
}
composeOptions {
// kotlinCompilerExtensionVersion = "1.4.3"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}

allprojects {
tasks.withType {
options.compilerArgs.addAll(arrayOf("-parameters", "-Xlint:deprecation"))
}
}
}

kotlin {
jvmToolchain(17)
}

ksp {
arg("jvmTarget", "17")
}

dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.activity:activity-compose:1.9.2")

implementation(project(mapOf("path" t o & q u o t ; : s e r v i c e & q u o t ; ) ) ) < b r / > i m p l e m e n t a t i o n ( f i l e s ( & q u o t ; l i b s / p r o n t o - r e l e a s e . a a r & q u o t ; ) ) < b r / > < b r / > / / K o t l i n < b r / > i m p l e m e n t a t i o n ( & q u o t ; o r g . j e t b r a i n s . k o t l i n x : k o t l i n x - c o r o u t i n e s - c o r e : 1 . 9 . 0 & q u o t ; ) < b r / > i m p l e m e n t a t i o n ( & q u o t ; o r g . j e t b r a i n s . k o t l i n x : k o t l i n x - c o r o u t i n e s - a n d r o i d : 1 . 9 . 0 & q u o t ; ) < b r / > < b r / > / / C o m p o s e < b r / > i m p l e m e n t a t i o n ( p l a t f o r m ( & q u o t ; a n d r o i d x . c o m p o s e : c o m p o s e - b o m : 2 0 2 4 . 0 9 . 0 3 & q u o t ; ) ) < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x . c o m p o s e . u i : u i & q u o t ; ) < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x . c o m p o s e . u i : u i - g r a p h i c s & q u o t ; ) < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x . c o m p o s e . u i : u i - t o o l i n g - p r e v i e w & q u o t ; ) < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x . c o m p o s e . m a t e r i a l 3 : m a t e r i a l 3 & q u o t ; ) < b r / > < b r / > / / L i f e c y c l e < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x . l i f e c y c l e : l i f e c y c l e - r u n t i m e - k t x : 2 . 8 . 6 & q u o t ; ) < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x . l i f e c y c l e : l i f e c y c l e - v i e w m o d e l - k t x : 2 . 8 . 6 & q u o t ; ) < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x . l i f e c y c l e : l i f e c y c l e - v i e w m o d e l - c o m p o s e : 2 . 8 . 6 & q u o t ; ) < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x . l i f e c y c l e : l i f e c y c l e - l i v e d a t a - k t x : 2 . 8 . 6 & q u o t ; ) < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x . l i f e c y c l e : l i f e c y c l e - r u n t i m e - c o m p o s e : 2 . 8 . 6 & q u o t ; ) < b r / > < b r / > / / N a v i g a t i o n 6 . 0 < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x . n a v i g a t i o n : n a v i g a t i o n - c o m p o s e : 2 . 8 . 2 & q u o t ; ) < b r / > < b r / > / / W o r k m a n a g e r < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x . w o r k : w o r k - r u n t i m e - k t x : 2 . 9 . 1 & q u o t ; ) < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x . w o r k : w o r k - m u l t i p r o c e s s : 2 . 9 . 1 & q u o t ; ) < b r / > < b r / > / / C a m e r a X < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x . c a m e r a : c a m e r a - c o r e : 1 . 3 . 4 & q u o t ; ) < b r / > i m p l e m e n t a t i o n ( & q u o t ; a n d r o i d x .camera:camera-camera2:1.3.4")
implementation("androidx.camera:camera-lifecycle:1.3.4")
implementation("androidx.camera:camera-video:1.3.4")
implementation("androidx.camera:camera-view:1.3.4")
implementation("androidx.camera:camera-extensions:1.3.4")

// Test
androidTestImplementation(platform("androidx.compose:compose-bom:2024.09.03"))
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")

// Hilt
implementation ("com.google.dagger:hilt-android:2.52")
ksp("com.google.dagger:hilt-android-compiler:2.52")

implementation ("androidx.hilt:hilt-navigation-compose:1.2.0")
implementation("androidx.hilt:hilt-work:1.2.0")
ksp("androidx.hilt:hilt-compiler:1.2.0")

// Firebase
implementation(platform("com.google.firebase:firebase-bom:28.0.0"))
implementation("com.google.firebase:firebase-analytics")
implementation("com.google.firebase:firebase-crashlytics")
implementation("com.google.firebase:firebase-auth")

// FirebaseUI for Firebase Auth
implementation("com.firebaseui:firebase-ui-auth:8.0.2")
implementation("com.google.android.gms:play-services-auth:20.6.0")

// Ktor
implementation("io.ktor:ktor-client-core:2.3.4")
implementation("io.ktor:ktor-client-cio:2.3.4")
implementation("io.ktor:ktor-client-json:2.3.4")
implementation("io.ktor:ktor-client-content-negotiation:2.3.4")
implementation("io.ktor:ktor-client-serialization:2.3.4")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.4")

// Coil
implementation("io.coil-kt:coil-compose:2.6.0")
implementation("io.coil-kt:coil:2.6.0")

// Guava
implementation("com.google.guava:guava:33.3.1-android")

// Splash Screen
implementation ("androidx.core:core-splashscreen:1.0.1")
implementation("androidx.compose.animation:animation-graphics:1.7.3")

// Realm MongoDB
implementation ("io.realm.kotlin:library-base:1.10.0")
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")

// Event Bus
implementation("org.greenrobot:eventbus:3.3.1")
// ExifInterface
implementation("androidx.exifinterface:exifinterface:1.3.7")
// Datastore
implementation("androidx.datastore:datastore-preferences:1.1.1")
// QrCode
implementation("com.github.androidmads:QRGenerator:1.0.1")
// GSON
implementation("com.google.code.gson:gson:2.11.0")
// ZoomImage
implementation ("net.engawapg.lib:zoomable:1.5.2")
// MixPanel
implementation("com.mixpanel.android:mixpanel-android:7.4.0")
//Tooltip Balloon
implementation("com.github.skydoves:balloon-compose:1.6.4")
// Datadog
implementation("com.datadoghq:dd-sdk-android-logs:2.6.2")
}

service Gradle kts я использую этот проект для обработки серверных служб
plugins {
id("com.android.library")
id("com.google.devtools.ksp")
id("org.jetbrains.kotlin.android")
id("io.realm.kotlin")
id("kotlinx-serialization")
id("com.google.gms.google-services")
id("com.google.dagger.hilt.android")
}

android {
namespace = "com.honcho.service"
compileSdk = 34

defaultConfig {
minSdk = 23
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}

create("beta") {}
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = 17.toString()
tasks.withType().configureEach {
kotlinOptions {
jvmTarget = 17.toString()
}
}
}
}

kotlin {
jvmToolchain(17)
}

ksp {
arg("jvmTarget", "17")
}

dependencies {

coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.2")
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.appcompat:appcompat:1.7.0")

// Kotlin
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.9.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")

// SDK Camera
compileOnly(files("libs/pronto-release.aar"))

// implementation("com.google.android.material:material:1.12.0")

// Guava
implementation("com.google.guava:guava:33.3.1-android")

// Hilt
implementation ("com.google.dagger:hilt-android:2.52")
ksp("com.google.dagger:hilt-android-compiler:2.52")

// Realm
implementation("io.realm.kotlin:library-base:3.0.0")

// Ktor
implementation("io.ktor:ktor-client-core:3.0.0")
implementation("io.ktor:ktor-client-okhttp:3.0.0")
implementation("io.ktor:ktor-client-auth:3.0.0")
implementation("io.ktor:ktor-client-logging:3.0.0")
implementation("io.ktor:ktor-client-content-negotiation:3.0.0")
implementation("io.ktor:ktor-client-serialization:3.0.0")
implementation("io.ktor:ktor-serialization-gson:3.0.0")

// Firebase
implementation(platform("com.google.firebase:firebase-bom:28.0.0"))
implementation("com.google.firebase:firebase-auth-ktx")

// FirebaseUI for Firebase Auth
implementation("com.firebaseui:firebase-ui-auth:8.0.2")
implementation("com.google.android.gms:play-services-auth:20.6.0")

// Test
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")

// Serialization
implementation("com.google.code.gson:gson:2.11.0")
// Centrifuge
implementation("io.github.centrifugal:centrifuge-java:0.4.2")
}

Это корневой Gradle
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.7.0" apply false
id("org.jetbrains.kotlin.android") version "1.9.25" apply false
id("com.google.devtools.ksp") version "1.9.25-1.0.20" apply false
id("org.gradle.toolchains.foojay-resolver-convention") version("0.5.0") apply false
id("io.realm.kotlin") version "1.10.0" apply false
id("com.android.library") version "8.7.0" apply false
id("com.google.dagger.hilt.android") version "2.52" apply false
id("com.google.gms.google-services") version "4.4.1" apply false
id("org.jetbrains.kotlin.plugin.serialization") version "1.8.10" apply false
id("com.google.firebase.crashlytics") version "2.9.9" apply false
}

subprojects {
afterEvaluate {
kotlinExtension.jvmToolchain(17)
}
}

configurations.all {
resolutionStrategy {
force("com.google.guava:guava:33.3.1-android")
}
}


Подробнее здесь: https://stackoverflow.com/questions/790 ... immutablem
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «JAVA»