diff --git a/android/build.gradle b/android/build.gradle index cf8de49d28..1e0c355fe8 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -69,32 +69,42 @@ apply plugin: 'ru.cian.huawei-publish-gradle-plugin' dependencies { // Google Mobile Services if (googleMobileServicesEnabled) { - implementation 'com.google.android.gms:play-services-location:19.0.1' + implementation 'com.google.android.gms:play-services-location:20.0.0' } // Google Firebase Services if (googleFirebaseServicesEnabled) { - implementation 'com.google.firebase:firebase-crashlytics:18.2.6' - implementation 'com.google.firebase:firebase-crashlytics-ndk:18.2.6' + // Import the BoM for the Firebase platform + implementation platform('com.google.firebase:firebase-bom:30.5.0') + // 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' } - implementation 'androidx.annotation:annotation:1.3.0' - implementation 'androidx.appcompat:appcompat:1.4.2' + implementation 'androidx.annotation:annotation:1.5.0' + implementation 'androidx.appcompat:appcompat:1.5.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.fragment:fragment:1.4.1' + implementation 'androidx.fragment:fragment:1.5.3' + // Lifecycle 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 + // > 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.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1) + // Duplicate class androidx.lifecycle.ViewTreeViewModelKt found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1) + implementation 'androidx.lifecycle:lifecycle-viewmodel:2.5.1' + implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1' implementation 'androidx.preference:preference:1.2.0' implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'androidx.work:work-runtime:2.7.1' - implementation 'com.google.android.material:material:1.7.0-alpha02' - implementation 'com.google.code.gson:gson:2.9.0' + implementation 'com.google.android.material:material:1.8.0-alpha01' + implementation 'com.google.code.gson:gson:2.9.1' implementation 'com.timehop.stickyheadersrecyclerview:library:0.4.3@aar' 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:4.6.0' - testImplementation 'org.mockito:mockito-inline:4.6.0' + testImplementation 'org.mockito:mockito-core:4.8.0' + testImplementation 'org.mockito:mockito-inline:4.8.0' } def run(cmd) { @@ -113,7 +123,7 @@ def getVersion() { def bash = isWindows ? 'C:\\Program Files\\Git\\bin\\bash.exe' : 'bash' def versionCode = Integer.parseInt(run([bash, '../tools/unix/version.sh', 'android_code']).trim()) def versionName = run([bash, '../tools/unix/version.sh', 'android_name']).trim() - return new groovy.lang.Tuple2(versionCode, versionName) + return new Tuple2(versionCode, versionName) } def getCommitMessage() { @@ -138,10 +148,10 @@ android { defaultConfig { // Default package name is taken from the manifest and should be app.organicmaps def ver = getVersion() - println('Version: ' + ver.second) - println('VersionCode: ' + ver.first) - versionCode = ver.first - versionName = ver.second + versionCode = ver.V1 + versionName = ver.V2 + println('Version: ' + versionName) + println('VersionCode: ' + versionCode) minSdkVersion propMinSdkVersion.toInteger() targetSdkVersion propTargetSdkVersion.toInteger() applicationId project.ext.appId @@ -220,7 +230,7 @@ android { res.srcDirs = ['tests/resources'] } - flavorDimensions "default" + flavorDimensions 'default' productFlavors { // 01 is a historical artefact, sorry. @@ -373,7 +383,7 @@ android { externalNativeBuild { cmake { - version "3.18.0+" + version "3.22.1+" buildStagingDirectory "./nativeOutputs" path "../CMakeLists.txt" } diff --git a/android/gradle.properties b/android/gradle.properties index f0911ada49..874ad2663f 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,7 +1,7 @@ propMinSdkVersion=21 -propTargetSdkVersion=31 -propCompileSdkVersion=31 -propBuildToolsVersion=32.0.0 +propTargetSdkVersion=33 +propCompileSdkVersion=33 +propBuildToolsVersion=33.0.0 org.gradle.caching=true org.gradle.jvmargs=-Xmx1024m -Xms256m diff --git a/android/jni/CMakeLists.txt b/android/jni/CMakeLists.txt index e82a603256..eb2f9b65d3 100644 --- a/android/jni/CMakeLists.txt +++ b/android/jni/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.22.1) project(organicmaps C CXX) diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 6b3e7f592d..d625a84a4e 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -77,7 +77,7 @@ You need a Linux or a Mac machine to build a desktop version of Organic Maps. Ensure that you have at least 20GB of free space. -Install Cmake (**3.18.1** minimum), Boost, Qt 5 and other dependencies. +Install Cmake (**3.22.1** minimum), Boost, Qt 5 and other dependencies. Installing *ccache* can speed up active development. @@ -244,11 +244,11 @@ Install Android SDK and NDK: - Run the Android Studio. - Open "SDK Manager" (under "More Actions" in a welcome screen or a three-dot menu in a list of recent projects screen or "Tools" top menu item in an open project). -- Select "Android 12.0 (S) / API Level 31" SDK. +- Select "Android 13.0 (T) / API Level 33" SDK. - Switch to "SDK Tools" tab. - Check "Show Package Details" checkbox. - Select "NDK (Side by side)" version **25.1.8937393**. -- Select "CMake" version **3.18.1**. +- Select "CMake" version **3.22.1**. - Click "Apply" and wait for downloads and installation to finish. - In the left pane menu select "Appearance & Behavior > System Settings > Memory Settings". - Set "IDE max heap size" to 2048Mb or more (otherwise the Studio might get stuck on "Updating indexes" when opening the project). @@ -312,13 +312,13 @@ First configure `PATH` to prefer `cmake` from Android SDK/NDK instead of one ins _Linux:_ ```bash -export PATH=$HOME/Android/Sdk/cmake/3.18.1/bin:$PATH +export PATH=$HOME/Android/Sdk/cmake/3.22.1/bin:$PATH ``` _macOS:_ ```bash -export PATH=$HOME/Library/Android/Sdk/cmake/3.18.1/bin:$PATH +export PATH=$HOME/Library/Android/Sdk/cmake/3.22.1/bin:$PATH ``` Check if you have a system-wide Java runtime environment (JRE) installed: @@ -388,8 +388,8 @@ To add any of those options to in-studio builds list them in "Command-line Optio You can install [Android SDK](https://developer.android.com/sdk/index.html) and [NDK](https://developer.android.com/tools/sdk/ndk/index.html) without -Android Studio. Please make sure that SDK for API Level 31, -NDK version **24.0.8215888** and CMake version **3.18.1** are installed. +Android Studio. Please make sure that SDK for API Level 33, +NDK version **25.1.8937393** and CMake version **3.22.1** are installed. If you are low on RAM, disk space or traffic there are ways to reduce system requirements: - in Android Studio enable "File > Power Save Mode";