@@ -38,11 +38,11 @@ kotlin {
3838android {
3939 namespace " com.mateusrodcosta.apps.vidyamusic"
4040
41- compileSdk 33
41+ compileSdk 34
4242 defaultConfig {
4343 applicationId " com.mateusrodcosta.apps.vidyamusic"
4444 minSdkVersion 26
45- targetSdkVersion 33
45+ targetSdkVersion 33
4646 versionCode flutterVersionCode. toInteger()
4747 versionName flutterVersionName
4848 }
@@ -76,6 +76,18 @@ android {
7676 }
7777 }
7878
79+ splits {
80+ abi {
81+ enable true
82+
83+ reset()
84+ // noinspection ChromeOsAbiSupport
85+ include " armeabi-v7a" , " arm64-v8a" , " x86_64"
86+
87+ universalApk true
88+ }
89+ }
90+
7991 compileOptions {
8092 sourceCompatibility JavaVersion . VERSION_17
8193 targetCompatibility JavaVersion . VERSION_17
@@ -85,6 +97,28 @@ android {
8597 }
8698}
8799
100+ ext. abiCodes = [' armeabi-v7a' : 1 , ' arm64-v8a' : 2 , x86_64 : 4 ]
101+
102+ android. applicationVariants. configureEach { variant ->
103+
104+ variant. outputs. each { output ->
105+
106+ def baseAbiVersionCode =
107+ project. ext. abiCodes. get(output. getFilter(" ABI" ))
108+
109+ if (baseAbiVersionCode != null ) {
110+
111+ output. versionCodeOverride =
112+ // As required by F-Droid, version code at beginning and abi code at the end
113+ // If wanting to build a universal APK with similar naming scheme, do so manually
114+ // via `--build-number` argument from `flutter build apk`
115+ variant. versionCode * 100 + baseAbiVersionCode
116+ // Default split apk version code, api code at beginning and version code at the end
117+ // baseAbiVersionCode * 1000 + variant.versionCode
118+ }
119+ }
120+ }
121+
88122flutter {
89123 source ' ../..'
90124}
0 commit comments