diff --git a/android/app/build.gradle b/android/app/build.gradle index 6c1b785613..d077d6c4f7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -72,51 +72,6 @@ if (googleFirebaseServicesEnabled) { apply plugin: 'com.github.triplet.play' apply plugin: 'ru.cian.huawei-publish-gradle-plugin' -dependencies { - // Google Mobile Services - if (googleMobileServicesEnabled) { - implementation 'com.google.android.gms:play-services-location:21.0.1' - } - - // Google Firebase Services - if (googleFirebaseServicesEnabled) { - // Import the BoM for the Firebase platform - implementation platform('com.google.firebase:firebase-bom:32.7.1') - // Add the dependencies for the Crashlytics and Analytics libraries - // When using the BoM, you don't specify versions in Firebase library dependencies - implementation 'com.google.firebase:firebase-crashlytics' - implementation 'com.google.firebase:firebase-crashlytics-ndk' - } - - // This line is added as a workaround for duplicate classes error caused by some outdated dependency: - // > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable - // We don't use Kotlin, but some dependencies are actively using it. - // See https://stackoverflow.com/a/75719642 - implementation 'androidx.core:core:1.12.0' - implementation(platform('org.jetbrains.kotlin:kotlin-bom:1.9.22')) - implementation 'androidx.annotation:annotation:1.7.1' - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.car.app:app:1.4.0-rc02' - implementation 'androidx.car.app:app-projected:1.4.0-rc2' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.fragment:fragment:1.6.2' - implementation 'androidx.preference:preference:1.2.1' - implementation 'androidx.recyclerview:recyclerview:1.3.2' - implementation 'androidx.work:work-runtime:2.9.0' - implementation 'androidx.lifecycle:lifecycle-process:2.7.0' - implementation 'com.google.android.material:material:1.11.0' - // Fix for app/organicmaps/util/FileUploadWorker.java:14: error: cannot access ListenableFuture - // https://github.com/organicmaps/organicmaps/issues/6106 - implementation 'com.google.guava:guava:32.1.3-android' - implementation 'com.github.devnullorthrow:MPAndroidChart:3.2.0-alpha' - implementation 'net.jcip:jcip-annotations:1.0' - - // Test Dependencies - testImplementation 'junit:junit:4.13.2' - testImplementation 'org.mockito:mockito-core:5.8.0' - testImplementation 'org.mockito:mockito-inline:5.2.0' -} - def run(cmd) { def stdout = new ByteArrayOutputStream() exec { @@ -417,6 +372,51 @@ android { } } +dependencies { + // Google Mobile Services + if (googleMobileServicesEnabled) { + implementation 'com.google.android.gms:play-services-location:21.0.1' + } + + // Google Firebase Services + if (googleFirebaseServicesEnabled) { + // Import the BoM for the Firebase platform + implementation platform('com.google.firebase:firebase-bom:32.7.1') + // Add the dependencies for the Crashlytics and Analytics libraries + // When using the BoM, you don't specify versions in Firebase library dependencies + implementation 'com.google.firebase:firebase-crashlytics' + implementation 'com.google.firebase:firebase-crashlytics-ndk' + } + + // This line is added as a workaround for duplicate classes error caused by some outdated dependency: + // > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable + // We don't use Kotlin, but some dependencies are actively using it. + // See https://stackoverflow.com/a/75719642 + implementation 'androidx.core:core:1.12.0' + implementation(platform('org.jetbrains.kotlin:kotlin-bom:1.9.22')) + implementation 'androidx.annotation:annotation:1.7.1' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'androidx.car.app:app:1.4.0-rc02' + implementation 'androidx.car.app:app-projected:1.4.0-rc2' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'androidx.fragment:fragment:1.6.2' + implementation 'androidx.preference:preference:1.2.1' + implementation 'androidx.recyclerview:recyclerview:1.3.2' + implementation 'androidx.work:work-runtime:2.9.0' + implementation 'androidx.lifecycle:lifecycle-process:2.7.0' + implementation 'com.google.android.material:material:1.11.0' + // Fix for app/organicmaps/util/FileUploadWorker.java:14: error: cannot access ListenableFuture + // https://github.com/organicmaps/organicmaps/issues/6106 + implementation 'com.google.guava:guava:32.1.3-android' + implementation 'com.github.devnullorthrow:MPAndroidChart:3.2.0-alpha' + implementation 'net.jcip:jcip-annotations:1.0' + + // Test Dependencies + testImplementation 'junit:junit:4.13.2' + testImplementation 'org.mockito:mockito-core:5.8.0' + testImplementation 'org.mockito:mockito-inline:5.2.0' +} + tasks.withType(JavaCompile) { options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation' }