Ошибка при создании проекта: приложение:checkDebugDuplateClassesAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Ошибка при создании проекта: приложение:checkDebugDuplateClasses

Сообщение Anonymous »

Мой проект многомодульный.
Когда я создаю проект, у меня возникает эта ошибка:

Код: Выделить всё

Execution failed for task ':app:mergeExtDexDebugAndroidTest'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform ddmlib-30.3.0.jar (com.android.tools.ddms:ddmlib:30.3.0) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for DexingWithClasspathTransform: C:\Users\Zakhar\.gradle\caches\modules-2\files-2.1\com.android.tools.ddms\ddmlib\30.3.0\f271cb990dc62f580b608a75c87c509683c75da9\ddmlib-30.3.0.jar.
> Error while dexing.
Increase the minSdkVersion to 26 or above.

Execution failed for task ':app:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
> 2 files found with path 'google/protobuf/field_mask.proto' from inputs:
- C:\Users\Zakhar\.gradle\caches\modules-2\files-2.1\com.google.protobuf\protobuf-javalite\3.21.7\82b692be08383107fd1c6d44474b56df411edd27\protobuf-javalite-3.21.7.jar
- C:\Users\Zakhar\.gradle\caches\modules-2\files-2.1\com.google.protobuf\protobuf-java\3.17.2\d7eec2ad499b605f24d07f49bdcb41c801aafbfc\protobuf-java-3.17.2.jar
Adding a packagingOptions block may help, please refer to
https://developer.android.com/reference/tools/gradle-api/8.1/com/android/build/api/dsl/ResourcesPackagingOptions
for more information

Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
>  Duplicate class com.google.protobuf.AbstractMessageLite found in modules protobuf-java-3.17.2 (com.google.protobuf:protobuf-java:3.17.2) and protobuf-javalite-3.21.7 (com.google.protobuf:protobuf-javalite:3.21.7)
Duplicate class com.google.protobuf.AbstractMessageLite$Builder found in modules protobuf-java-3.17.2 (com.google.protobuf:protobuf-java:3.17.2) and protobuf-javalite-3.21.7 (com.google.protobuf:protobuf-javalite:3.21.7)

Я пытался изменить версии библиотек, agp, п л а г и н b u i l d . g r a d l e . < / p > < b r / > В о т м о й к о д и з к а ж д ы й м о д у л ь b u i l d . g r a d l e . k t s : < / p > < b r / > п р и ложение:

Код: Выделить всё

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.gms.google-services")
id("com.google.devtools.ksp")
}

android {
namespace = "com.nutrition.caloriecountingapp"
compileSdk = 34

defaultConfig {
applicationId = "com.nutrition.caloriecountingapp"
minSdk = 21
targetSdk = 34
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
viewBinding.isEnabled = true

}

val daggerVersion = "2.48"
dependencies {
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.10.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.navigation:navigation-fragment-ktx:2.7.5")
implementation("androidx.navigation:navigation-ui-ktx:2.7.5")
implementation("com.google.android.gms:play-services-ads-lite:22.5.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")

implementation(project(":feature_auth"))
implementation(project(":feature_home"))
implementation(project(":feature_search"))
implementation(project(":feature_profile"))
implementation(project(":core"))
implementation(project(":db"))
implementation(project(":network"))

implementation("com.google.gms:google-services:4.4.0")

// Dagger
implementation("com.google.dagger:dagger:$daggerVersion")
ksp ("com.google.dagger:dagger-compiler:$daggerVersion")
}
:ядро

Код: Выделить всё

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
}

android {
namespace = "com.nutrition.core"
compileSdk = 34

defaultConfig {
minSdk = 21

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

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
viewBinding.isEnabled = true
}

dependencies {
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.10.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}
:db

Код: Выделить всё

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("com.google.devtools.ksp")
}

android {
namespace = "com.test.db"
compileSdk = 34

defaultConfig {
minSdk = 21
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
kotlin{
ksp{
arg("room.schemaLocation",  & q u o t ; $ p r o j e c t D i r / s c h e m a s & q u o t ; ) < b r   / >                       } < b r   / >               } < b r   / >         } < b r   / > < b r   / >         b u i l d T y p e s   { < b r   / >                 r e l e a s e   { < b r   / >                         i s M i n i f y E n a b l e d   =   f a l s e < b r   / >                         p r o g u a r d F i l e s ( < b r   / >                                 g e t D e f a u l t P r o g u a r d F i l e ( & q u o t ; p r o g u a r d - a n d r o i d - o p t i m i z e . t x t & q u o t ; ) , < b r   / >                                 & q u o t ; p r o g u a r d - r u l e s . p r o & q u o t ; < b r   / >                         ) < b r   / >                 } < b r   / >         } < b r   / >         c o m p i l e O p t i o n s   { < b r   / >                 s o u r c e C o m p a t i b i l i t y   =   J a v a V e r s i o n . V E R S I O N _ 1 _ 8 < b r   / >                 t a r g e t C o m p a t i b i l i t y   =   J a v a V e r s i o n . V E R S I O N _ 1 _ 8 < b r   / >         } < b r   / >         k o t l i n O p t i o n s   { < b r   / >                 j v m T a r g e t   =   & q u o t ; 1 . 8 & q u o t ; < b r   / >         } < b r   / > } < b r   / > < b r   / > d e p e n d e n c i e s   { < b 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 . c o r e : c o r e - k t x : 1 . 1 2 . 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 ; a n d r o i d x . a p p c o m p a t : a p p c o m p a t : 1 . 6 . 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 ; c o m . g o o g l e . a n d r o i d . m a t e r i a l : m a t e r i a l : 1 . 1 0 . 0 & q u o t ; ) < b r   / >         t e s t I m p l e m e n t a t i o n ( & q u o t ; j u n i t : j u n i t : 4 . 1 3 . 2 & q u o t ; ) < b r   / >         a n d r o i d T e s t 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 . t e s t . e x t : j u n i t : 1 . 1 . 5 & q u o t ; ) < b r   / >         a n d r o i d T e s t 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 . t e s t . e s p r e s s o : e s p r e s s o - c o r e : 3 . 5 . 1 & q u o t ; ) < b r   / > < b r   / >         / /   R o o m < 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 . r o o m : r o o m - r u n t i m e : 2 . 6 . 1 & q u o t ; ) < b r   / >         k s p ( & q u o t ; a n d r o i d x . r o o m : r o o m - c o m p i l e r : 2 . 6 . 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 . r o o m : r o o m - k t x : 2 . 6 . 1 & q u o t ; ) < b r   / > < b r   / >         / /   D a g g e r < b r   / >         v a l   d a g g e r V e r s i o n   =   & q u o t ; 2 . 4 8 & q u o t ; < b r   / >         c o m p i l e O n l y ( & q u o t ; c o m . g o o g l e . d a g g e r : d a g g e r : $ d a g g e r V e r s i o n & q u o t ; ) < b r   / >         k s p   ( & q u o t ; c o m . g o o g l e . d a g g e r : d a g g e r - c o m p i l e r : $ d a g g e r V e r s i o n & q u o t ; ) < b r   / > } < b r   / > < / c o d e > < b r   / > : f e a t u r e _ a u t h < / p > < b r   / > < c o d e > p l u g i n s   { < b r   / >         i d ( & q u o t ; c o m . a n d r o i d . l i b r a r y & q u o t ; ) < b r   / >         i d ( & q u o t ; o r g . j e t b r a i n s . k o t l i n . a n d r o i d & q u o t ; ) < b r   / >         i d ( & q u o t ; c o m . g o o g l e . d e v t o o l s . k s p & q u o t ; ) < b r   / > } < b r   / > < b r   / > a n d r o i d   { < b r   / >         n a m e s p a c e   =   & q u o t ; c o m . n u t r i t i o n . f e a t u r e _ a u t h & q u o t ; < b r   / >         c o m p i l e S d k   =   3 4 < b r   / > < b r   / >         d e f a u l t C o n f i g   { < b r   / >                 m i n S d k   =   2 1 < b r   / > < b r   / >                 t e s t I n s t r u m e n t a t i o n R u n n e r   =   & q u o t ; a n d r o i d x . t e s t . r u n n e r . A n d r o i d J U n i t R u n n e r & q u o t ; < b r   / >                 c o n s u m e r P r o g u a r d F i l e s ( & q u o t ; c o n s u m e r - r u l e s . p r o & q u o t ; ) < b r   / >         } < b r   / > < b r   / >         b u i l d T y p e s   { < b r   / >                 r e l e a s e   { < b r   / >                         i s M i n i f y E n a b l e d   =   f a l s e < b r   / >                         p r o g u a r d F i l e s ( < b r   / >                                 g e t D e f a u l t P r o g u a r d F i l e ( & q u o t ; p r o g u a r d - a n d r o i d - o p t i m i z e . t x t & q u o t ; ) , < b r   / >                                 & q u o t ; p r o g u a r d - r u l e s . p r o & q u o t ; < b r   / >                         ) < b r   / >                 } < b r   / >         } < b r   / >         c o m p i l e O p t i o n s   { < b r   / >                 s o u r c e C o m p a t i b i l i t y   =   J a v a V e r s i o n . V E R S I O N _ 1 _ 8 < b r   / >                 t a r g e t C o m p a t i b i l i t y   =   J a v a V e r s i o n . V E R S I O N _ 1 _ 8 < b r   / >         } < b r   / >         k o t l i n O p t i o n s   { < b r   / >                 j v m T a r g e t   =   & q u o t ; 1 . 8 & q u o t ; < b r   / >         } < b r   / >         v i e w B i n d i n g . i s E n a b l e d   =   t r u e < b r   / > } < b r   / > < b r   / > < b r   / > d e p e n d e n c i e s   { < b r   / >         i m p l e m e n t a t i o n ( & q u o t ; c o m . g o o g l e . a n d r o i d . g m s : p l a y - s e r v i c e s - a d s : 2 2 . 5 . 0 & q u o t ; ) < b 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 . c o r e : c o r e - k t x : 1 . 1 2 . 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 ; a n d r o i d x . a p p c o m p a t : a p p c o m p a t : 1 . 6 . 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 ; c o m . g o o g l e . a n d r o i d . m a t e r i a l : m a t e r i a l : 1 . 1 0 . 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 ; a n d r o i d x . f r a g m e n t : f r a g m e n t - k t x : 1 . 6 . 2 & q u o t ; ) < b r   / > < b r   / >         / /   c o r e < b r   / >         i m p l e m e n t a t i o n ( p r o j e c t ( & q u o t ; : c o r e & q u o t ; ) ) < b r   / > < b r   / >         / /   d b < b r   / >         i m p l e m e n t a t i o n ( p r o j e c t ( & q u o t ; : d b & q u o t ; ) ) < b r   / > < b r   / >         / /   N a v i g a t i o n < 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 - f r a g m e n t - k t x : 2 . 7 . 5 & 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 . n a v i g a t i o n : n a v i g a t i o n - u i - k t x : 2 . 7 . 5 & q u o t ; ) < b r   / > < b r   / >         / /   L i f e c y c l e < b r   / >         v a l   l i f e c y c l e V e r s i o n   =   & q u o t ; 2 . 6 . 2 & 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 - k t x : $ l i f e c y c l e V e r s i o n & q u o t ; ) < b r   / > < b r   / >         / /   T e s t i n g < b r   / >         t e s t I m p l e m e n t a t i o n ( & q u o t ; j u n i t : j u n i t : 4 . 1 3 . 2 & q u o t ; ) < b r   / >         a n d r o i d T e s t 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 . t e s t . e x t : j u n i t : 1 . 1 . 5 & q u o t ; ) < b r   / >         a n d r o i d T e s t 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 . t e s t . e s p r e s s o : e s p r e s s o - c o r e : 3 . 5 . 1 & q u o t ; ) < b r   / >         t e s t I m p l e m e n t a t i o n ( & q u o t ; i o . m o c k k : m o c k k : 1 . 1 3 . 5 & q u o t ; ) < b r   / >         t e s t 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 - t e s t : 1 . 7 . 3 & q u o t ; ) < b r   / > < b r   / >         / /   D a g g e r < b r   / >         v a l   d a g g e r V e r s i o n   =   & q u o t ; 2 . 4 8 & q u o t ; < b r   / >         c o m p i l e O n l y ( & q u o t ; c o m . g o o g l e . d a g g e r : d a g g e r : $ d a g g e r V e r s i o n & q u o t ; ) < b r   / >         k s p   ( & q u o t ; c o m . g o o g l e . d a g g e r : d a g g e r - c o m p i l e r : $ d a g g e r V e r s i o n & q u o t ; ) < b r   / > < b r   / >         / /   F i r e b a 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 ; c o m . g o o g l e . f i r e b a s e : f i r e b a s e - b o m : 3 2 . 6 . 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 ; c o m . g o o g l e . f i r e b a s e : f i r e b a s e - a u t h - k t x & q u o t ; ) < b r   / >         i m p l e m e n t a t i o n ( & q u o t ; c o m . g o o g l e . a n d r o i d . g m s : p l a y - s e r v i c e s - a u t h : 2 0 . 7 . 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 ; c o m . g o o g l e . f i r e b a s e : f i r e b a s e - f i r e s t o r e - k t x : 2 4 . 9 . 1 & q u o t ; ) < b r   / > < b r   / >         / /   W o r k M a n a g e r < b r   / >         v a l   w o r k M a n a g e r V e r s i o n   =   & q u o t ; 2 . 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 ; a n d r o i d x . w o r k : w o r k - r u n t i m e : $ w o r k M a n a g e r V e r s i o n & 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 - r u n t i m e - k t x : $ w o r k M a n a g e r V e r s i o n & q u o t ; ) < b r   / >         < b r   / >         / /   V i e w M o d e l < 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 : $ l i f e c y c l e V e r s i o n & q u o t ; ) < b r   / > < b r   / > } < b r   / > < / c o d e > < b r   / > < h r   / > < b r   / > : f e a t u r e _ h o m e < / p > < b r   / > < c o d e > p l u g i n s   { < b r   / >         i d ( & q u o t ; c o m . a n d r o i d . l i b r a r y & q u o t ; ) < b r   / >         i d ( & q u o t ; o r g . j e t b r a i n s . k o t l i n . a n d r o i d & q u o t ; ) < b r   / >         i d ( & q u o t ; k o t l i n - k a p t & q u o t ; ) < b r   / > } < b r   / > < b r   / > a n d r o i d   { < b r   / >         n a m e s p a c e   =   & q u o t ; c o m . n u t r i t i o n . f e a t u r e _ h o m e & q u o t ; < b r   / >         c o m p i l e S d k   =   3 4 < b r   / > < b r   / >         d e f a u l t C o n f i g   { < b r   / >                 m i n S d k   =   2 1 < b r   / > < b r   / >                 t e s t I n s t r u m e n t a t i o n R u n n e r   =   & q u o t ; a n d r o i d x . t e s t . r u n n e r . A n d r o i d J U n i t R u n n e r & q u o t ; < b r   / >                 c o n s u m e r P r o g u a r d F i l e s ( & q u o t ; c o n s u m e r - r u l e s . p r o & q u o t ; ) < b r   / >         } < b r   / > < b r   / >         b u i l d T y p e s   { < b r   / >                 r e l e a s e   { < b r   / >                         i s M i n i f y E n a b l e d   =   f a l s e < b r   / >                         p r o g u a r d F i l e s ( < b r   / >                                 g e t D e f a u l t P r o g u a r d F i l e ( & q u o t ; p r o g u a r d - a n d r o i d - o p t i m i z e . t x t & q u o t ; ) , < b r   / >                                 & q u o t ; p r o g u a r d - r u l e s . p r o & q u o t ; < b r   / >                         ) < b r   / >                 } < b r   / >         } < b r   / >         c o m p i l e O p t i o n s   { < b r   / >                 s o u r c e C o m p a t i b i l i t y   =   J a v a V e r s i o n . V E R S I O N _ 1 _ 8 < b r   / >                 t a r g e t C o m p a t i b i l i t y   =   J a v a V e r s i o n . V E R S I O N _ 1 _ 8 < b r   / >         } < b r   / >         k o t l i n O p t i o n s   { < b r   / >                 j v m T a r g e t   =   & q u o t ; 1 . 8 & q u o t ; < b r   / >         } < b r   / >         v i e w B i n d i n g . i s E n a b l e d   =   t r u e < b r   / > } < b r   / > < b r   / > < b r   / > < b r   / > d e p e n d e n c i e s   { < 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 r e : c o r e - k t x : 1 . 1 2 . 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 ; a n d r o i d x . a p p c o m p a t : a p p c o m p a t : 1 . 6 . 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 ; c o m . g o o g l e . a n d r o i d . m a t e r i a l : m a t e r i a l : 1 . 1 0 . 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 ; 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 - f r a g m e n t - k t x : 2 . 7 . 5 & 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 . n a v i g a t i o n : n a v i g a t i o n - u i - k t x : 2 . 7 . 5 & q u o t ; ) < b r   / >         t e s t I m p l e m e n t a t i o n ( & q u o t ; j u n i t : j u n i t : 4 . 1 3 . 2 & q u o t ; ) < b r   / >         a n d r o i d T e s t 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 . t e s t . e x t : j u n i t : 1 . 1 . 5 & q u o t ; ) < b r   / >         a n d r o i d T e s t 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 . t e s t . e s p r e s s o : e s p r e s s o - c o r e : 3 . 5 . 1 & q u o t ; ) < b r   / > < b r   / >         / /   D a g g e r < b r   / >         v a l   d a g g e r V e r s i o n   =   & q u o t ; 2 . 4 8 & q u o t ; < b r   / >         c o m p i l e O n l y ( & q u o t ; c o m . g o o g l e . d a g g e r : d a g g e r : $ d a g g e r V e r s i o n & q u o t ; ) < b r   / >         k a p t   ( & q u o t ; c o m . g o o g l e . d a g g e r : d a g g e r - c o m p i l e r : $ d a g g e r V e r s i o n & q u o t ; ) < b r   / >         < b r   / >         i m p l e m e n t a t i o n ( p r o j e c t ( & q u o t ; : c o r e & q u o t ; ) ) < b r   / >         i m p l e m e n t a t i o n ( p r o j e c t ( & q u o t ; : d b & q u o t ; ) )

// Glide
implementation("com.github.bumptech.glide:glide:4.16.0")

}
:feature_profile

Код: Выделить всё

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
}

android {
namespace = "com.test.feature_profile"
compileSdk = 34

defaultConfig {
minSdk = 21

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

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
viewBinding.isEnabled = true
}

dependencies {

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.10.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}
:feature_search

Код: Выделить всё

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("kotlin-kapt")
id("kotlinx-serialization")
}

android {
namespace = "com.nutrition.feature_search"
compileSdk = 34

defaultConfig {
minSdk = 21

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

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
viewBinding.isEnabled = true
}

dependencies {
implementation("androidx.navigation:navigation-fragment-ktx:2.7.5")
implementation("androidx.navigation:navigation-ui-ktx:2.7.5")
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.10.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")

// Dagger
val daggerVersion = "2.48"
compileOnly("com.google.dagger:dagger:$daggerVersion")
kapt("com.google.dagger:dagger-compiler:$daggerVersion")

implementation(project(":core"))

}

Код: Выделить всё

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
}

android {
namespace = "com.test.network"
compileSdk = 34

defaultConfig {
minSdk = 21

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

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {

}

Код: Выделить всё

// gradle.properties
# Project-wide Gradle settings.
# IDE (e.g.  Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
Надеюсь, ваш ответ поможет решить эту проблему.

Подробнее здесь: https://stackoverflow.com/questions/775 ... ateclasses
Ответить

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

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

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

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

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