couldn't find inline method Landroidx/compose/RememberKt
При компиляции проекта, единственное, что вызывает ошибку - это строчка:
var state by remember { mutableStateOf(SelectedState.NONE) }
Проект вызывает огромную ошибку, в конечном итоге выдающая:
Caused by: java.lang.IllegalStateException: couldn't find inline method Landroidx/compose/RememberKt;.remember(Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
Что я пробывал:
- Полностью чистил кэш загрузок библиотек
- Следовал этом советам
- Возвращал проект на момент, когда он работал
- Менял версии Kotlin, Java, библиотек, Android Plugin и др
- Вручную добавлял библиотеку
androidx.compose.runtime
В итоге ошибка никак не исчезла. Мои gradle файлы:
Модульный:
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
def name = "com.adisalagic.thedoctorteam"
compileSdk 32
defaultConfig {
namespace name
applicationId name
minSdk 26
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
// coreLibraryDesugaringEnabled true
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}
dependencies {
// coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
implementation 'androidx.core:core-ktx:1.8.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
implementation 'androidx.activity:activity-compose:1.5.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation 'androidx.ui:ui-framework:0.1.0-dev10'
implementation 'androidx.ui:ui-layout:0.1.0-dev10'
implementation 'androidx.ui:ui-material:0.1.0-dev10'
implementation 'androidx.ui:ui-tooling:0.1.0-dev10'
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
def nav_version = "2.5.1"
implementation("androidx.navigation:navigation-compose:$nav_version")
// implementation 'com.github.kizitonwose:CalendarView:1.1.0'
// https://mvnrepository.com/artifact/org.videolan.android/libvlc-all
implementation group: 'org.videolan.android', name: 'libvlc-all', version: '4.0.0-eap2'
// https://mvnrepository.com/artifact/androidx.compose/compose-runtime
implementation 'androidx.compose:compose-runtime:0.1.0-dev14'
}
Проекта:
buildscript {
ext {
compose_version = '1.1.0-beta03'
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.2' apply false
id 'com.android.library' version '7.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.5.31' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Настройки:
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "TheDoctorTeam"
include ':app'
Ответы (1 шт):
Автор решения: AdisAlagic
→ Ссылка
Ответ оказался простым.
Две библиотеки конфликтуют с собой, поэтому я убрал строчку
implementation 'androidx.compose:compose-runtime:0.1.0-dev14'