Skip to content

Commit 4231387

Browse files
F-Droid's split per ABI support; upgrade dependencies
1 parent c596720 commit 4231387

File tree

3 files changed

+55
-18
lines changed

3 files changed

+55
-18
lines changed

BUILD.md

+10-13
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
To build, you need to install [Flutter](https://flutter.dev/docs/get-started/install).
44

55
Enter the following command in the terminal to build the project:
6-
- **Android APK**
7-
```
8-
flutter build apk
9-
```
10-
You can also split APK into different architectures:
11-
```
12-
flutter build apk --split-per-abi
13-
```
14-
or
15-
```
16-
flutter build apk --target-platform [android-arm|android-arm64|android-x64]
17-
```
18-
The built APK will be located in the `build/app/outputs/flutter-apk/` directory.
6+
7+
- **Android APK**
8+
```
9+
flutter build apk --flavor base
10+
```
11+
or
12+
```
13+
flutter build apk --target-platform [android-arm|android-arm64|android-x64] --flavor base
14+
```
15+
The built APK will be located in the `build/app/outputs/flutter-apk/` directory.

android/app/build.gradle

+42-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import com.android.build.OutputFile
2+
13
plugins {
24
id "com.android.application"
35
id "kotlin-android"
@@ -39,6 +41,14 @@ android {
3941
versionName flutterVersionName
4042
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4143
multiDexEnabled = true
44+
45+
ndk {
46+
abiFilters "armeabi-v7a", "arm64-v8a", "x86_64"
47+
}
48+
}
49+
50+
buildFeatures {
51+
flavorDimensions = ["deploy"]
4252
}
4353

4454
compileOptions {
@@ -68,21 +78,51 @@ android {
6878
}
6979
}
7080

81+
productFlavors {
82+
base {
83+
dimension "deploy"
84+
}
85+
fdroid {
86+
dimension "deploy"
87+
}
88+
}
89+
7190
buildTypes {
7291
release {
7392
signingConfig signingConfigs.release
7493
}
94+
debug {
95+
signingConfig signingConfigs.debug
96+
}
97+
}
98+
99+
splits {
100+
abi {
101+
enable true
102+
reset()
103+
include "armeabi-v7a", "arm64-v8a", "x86_64"
104+
universalApk true
105+
}
106+
}
107+
108+
project.ext.versionCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86_64': 3]
109+
def baseCode = 5000
110+
applicationVariants.configureEach { variant ->
111+
outputs.configureEach { output ->
112+
versionCodeOverride =
113+
baseCode + versionCode * 10 + project.ext.versionCodes.get(output.getFilter(OutputFile.ABI), 0)
114+
}
75115
}
76116
}
77117

78118
flutter {
79119
source '../..'
80120
}
81121

82-
def acraVersion = '5.11.3'
122+
def acraVersion = '5.11.4'
83123

84124
dependencies {
85-
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.1")
125+
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.2")
86126

87127
testImplementation 'junit:junit:4.13.2'
88128
testImplementation 'org.mockito:mockito-core:5.2.0'

android/settings.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ pluginManagement {
2121
}
2222

2323
plugins {
24-
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
25-
id "com.android.application" version "8.5.2" apply false
26-
id "org.jetbrains.kotlin.android" version "2.0.10" apply false
24+
id "dev.flutter.flutter-plugin-loader" version "1.0.2"
25+
id "com.android.application" version '8.6.1' apply false
26+
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
2727
}
2828

2929
include ":app"

0 commit comments

Comments
 (0)