optimize build
This commit is contained in:
parent
8c44879150
commit
20e07cb656
4 changed files with 34 additions and 13 deletions
15
build.gradle
15
build.gradle
|
@ -107,3 +107,18 @@ subprojects {
|
|||
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
|
||||
}
|
||||
}
|
||||
|
||||
// This is necessary to prevent Gradle build errors like:
|
||||
//
|
||||
// Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0)
|
||||
//
|
||||
// By explicitly adding these dependencies, the jetifier
|
||||
// is forced to use the correct lifecycle version instead
|
||||
// of automatically picking 2.3.1.
|
||||
//
|
||||
// See: https://stackoverflow.com/a/69832319/560774
|
||||
configurations {
|
||||
all {
|
||||
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
|
||||
}
|
||||
}
|
|
@ -25,16 +25,4 @@ android {
|
|||
dependencies {
|
||||
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
|
||||
kapt "com.google.dagger:dagger-compiler:$dagger_version"
|
||||
|
||||
// This is necessary to prevent Gradle build errors like:
|
||||
//
|
||||
// Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0)
|
||||
//
|
||||
// By explicitly adding these dependencies, the jetifier
|
||||
// is forced to use the correct lifecycle version instead
|
||||
// of automatically picking 2.3.1.
|
||||
//
|
||||
// See: https://stackoverflow.com/a/69832319/560774
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
|
||||
}
|
||||
|
|
|
@ -7,11 +7,14 @@ plugins {
|
|||
}
|
||||
|
||||
apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle"
|
||||
|
||||
android {
|
||||
|
||||
namespace 'info.nightscout.database.entities'
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = false
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
|
|
@ -133,3 +133,18 @@ dependencies {
|
|||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
// This is necessary to prevent Gradle build errors like:
|
||||
//
|
||||
// Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0)
|
||||
//
|
||||
// By explicitly adding these dependencies, the jetifier
|
||||
// is forced to use the correct lifecycle version instead
|
||||
// of automatically picking 2.3.1.
|
||||
//
|
||||
// See: https://stackoverflow.com/a/69832319/560774
|
||||
configurations {
|
||||
all {
|
||||
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue