
все работает нормально, но возникает проблема, когда я пытаюсь изменить minifyEnabled на true (запутать)
затем возникает эта ошибка:
Код: Выделить всё
> Task :favorite:dexBuilderDebug
> Task :favorite:mergeProjectDexDebug
> Task :app:minifyDebugWithR8 FAILED
AGPBI: {"kind":"error","text":"Type com.example.recipes.ui.detail.RecipeInformationFragmentArgs$Companion is defined multiple times: C:\\Users\\wahyu\\rootProject\\Project\\Android\\Recipes\\app\\build\\intermediates\\module_and_runtime_deps_classes\\debug\\base.jar:com/example/recipes/ui/detail/RecipeInformationFragmentArgs$Companion.class, C:\\Users\\wahyu\\rootProject\\Project\\Android\\Recipes\\favorite\\build\\intermediates\\module_and_runtime_deps_classes\\debug\\feature-favorite.jar:com/example/recipes/ui/detail/RecipeInformationFragmentArgs$Companion.class","sources":[{"file":"C:\\Users\\wahyu\\rootProject\\Project\\Android\\Recipes\\app\\build\\intermediates\\module_and_runtime_deps_classes\\debug\\base.jar"}],"tool":"R8"}

Я пытался сделать недействительным, перестроить, очистить, но это не сработает.
И я попытался реорганизовать примитивные аргументы идентификатора с помощью Parcelable и аннотировать их с помощью @Keep (как сказано в документации), но ошибка все равно возникает.
Вот мое приложение build.gradle:
Код: Выделить всё
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'androidx.navigation.safeargs.kotlin'
id 'com.google.dagger.hilt.android'
}
apply from: "../shared_dependencies.gradle"
android {
namespace 'com.example.recipes'
compileSdk 33
defaultConfig {
applicationId "com.example.recipes"
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
dynamicFeatures = [':favorite']
}
dependencies {
api project(":core")
//? safeArgs
api "androidx.navigation:navigation-fragment-ktx:2.5.3"
api "androidx.navigation:navigation-ui-ktx:2.5.3"
api "androidx.navigation:navigation-dynamic-features-fragment:2.5.3"
//? ui
implementation "androidx.drawerlayout:drawerlayout:1.1.1"
}
kapt {
correctErrorTypes true
}
Код: Выделить всё
id 'com.android.dynamic-feature'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'com.google.dagger.hilt.android'
id 'androidx.navigation.safeargs.kotlin'
}
apply from: "../shared_dependencies.gradle"
android {
namespace 'com.example.recipe.favorite'
compileSdk 33
buildFeatures{
viewBinding true
}
defaultConfig {
minSdk 21
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation project(":app")
implementation project(":core")
}
Подробнее здесь: https://stackoverflow.com/questions/752 ... odule-with
Мобильная версия