Skip to content

Commit e0f3edc

Browse files
authored
build: support 16KB page size and bump minSdkVersion to 21 (#604)
1 parent 130320c commit e0f3edc

3 files changed

Lines changed: 284 additions & 4 deletions

File tree

Android/app/build.gradle

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ dependencies {
127127
// For Firebase Analytics, etc.
128128
implementation 'com.google.firebase:firebase-analytics:19.0.2' // Last version for API <19
129129
implementation 'com.google.firebase:firebase-perf:20.0.4'
130-
implementation 'com.google.firebase:firebase-crashlytics:18.2.6'
131-
implementation 'com.google.firebase:firebase-crashlytics-ndk:18.2.6'
130+
implementation 'com.google.firebase:firebase-crashlytics:19.0.2'
131+
implementation 'com.google.firebase:firebase-crashlytics-ndk:19.0.2'
132132
implementation 'com.google.firebase:firebase-config:21.0.1'
133133

134134
// Go backend (use fileTree instead of files to prevent Android Studio sync errors)
@@ -157,7 +157,12 @@ tasks.register('compileGoBackend', Exec) {
157157
System.getenv('PATH')
158158

159159
commandLine("${goBuildDir}/gomobile", 'bind',
160-
'-ldflags=-s -w',
160+
// -s -w: Omit symbol table and debug info to reduce binary size.
161+
// -extldflags: Pass flags to the external linker (e.g., Clang):
162+
// * -Wl: Pass the subsequent option to the linker.
163+
// * -z: Pass a keyword option to the linker.
164+
// * max-page-size=16384: Align ELF to 16KB page for Android 15+.
165+
'-ldflags=-s -w -extldflags=-Wl,-z,max-page-size=16384',
161166
'-target=android',
162167
"-androidapi=${android.defaultConfig.minSdk}",
163168
'-o', goBackendAAR,

Android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ android.nonFinalResIds=false
3030
ANDROID_COMPILE_SDK_VERSION=35
3131
ANDROID_BUILD_TOOLS_VERSION=35.0.0
3232

33-
ANDROID_MIN_SDK_VERSION=16
33+
ANDROID_MIN_SDK_VERSION=21
3434
ANDROID_TARGET_SDK_VERSION=35

0 commit comments

Comments
 (0)