Skip to content

Commit feb7124

Browse files
committed
Update Android build to be compatible with 16 Kb page size requirements (fixes #124)
We upgrade to Android NDK 28.1.13356709 and Android Gradle Plugin 8.7.3.
1 parent a07bc39 commit feb7124

File tree

10 files changed

+24
-11
lines changed

10 files changed

+24
-11
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
shell: bash
4444
run: |
4545
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV
46-
echo "ANDROID_NDK_VERSION=27.2.12479018" >> $GITHUB_ENV
46+
echo "ANDROID_NDK_VERSION=28.1.13356709" >> $GITHUB_ENV
4747
- name: Cached Android NDK
4848
if: matrix.os == 'ubuntu-latest'
4949
uses: actions/cache@v4
@@ -109,7 +109,7 @@ jobs:
109109
api-level: 27
110110
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
111111
ndk: ${{ env.ANDROID_NDK_VERSION }}
112-
cmake: 3.22.1
112+
cmake: 3.31.5
113113
script: ./gradlew connectedCheck
114114
- name: Publish Linux
115115
if: matrix.os == 'ubuntu-latest'

.github/workflows/snapshot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
shell: bash
5252
run: |
5353
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV
54-
echo "ANDROID_NDK_VERSION=27.2.12479018" >> $GITHUB_ENV
54+
echo "ANDROID_NDK_VERSION=28.1.13356709" >> $GITHUB_ENV
5555
- name: Cached Android NDK
5656
if: matrix.os == 'ubuntu-latest'
5757
uses: actions/cache@v4
@@ -117,7 +117,7 @@ jobs:
117117
api-level: 27
118118
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
119119
ndk: ${{ env.ANDROID_NDK_VERSION }}
120-
cmake: 3.22.1
120+
cmake: 3.31.5
121121
script: ./gradlew connectedCheck
122122
- name: Publish Linux
123123
if: matrix.os == 'ubuntu-latest'

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
shell: bash
5555
run: |
5656
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV
57-
echo "ANDROID_NDK_VERSION=27.2.12479018" >> $GITHUB_ENV
57+
echo "ANDROID_NDK_VERSION=28.1.13356709" >> $GITHUB_ENV
5858
- name: Cached Android NDK
5959
if: matrix.os == 'ubuntu-latest'
6060
uses: actions/cache@v4
@@ -120,5 +120,5 @@ jobs:
120120
api-level: 27
121121
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
122122
ndk: ${{ env.ANDROID_NDK_VERSION }}
123-
cmake: 3.22.1
123+
cmake: 3.31.5
124124
script: ./gradlew connectedCheck

build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ buildscript {
1717
}
1818

1919
dependencies {
20-
classpath("com.android.tools.build:gradle:8.2.2")
20+
classpath("com.android.tools.build:gradle:8.7.3")
2121
}
2222
}
2323

2424
allprojects {
2525
group = "fr.acinq.secp256k1"
26-
version = "0.18.0"
26+
version = "0.19.0-SNAPSHOT"
2727

2828
repositories {
2929
google()
@@ -41,6 +41,8 @@ kotlin {
4141
jvm {
4242
compilerOptions {
4343
jvmTarget.set(JvmTarget.JVM_1_8)
44+
// See https://jakewharton.com/kotlins-jdk-release-compatibility-flag/ and https://youtrack.jetbrains.com/issue/KT-49746/
45+
freeCompilerArgs.add("-Xjdk-release=1.8")
4446
}
4547
}
4648

jni/android/build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ kotlin {
1111
explicitApi()
1212
compilerOptions {
1313
jvmTarget.set(JvmTarget.JVM_1_8)
14+
// Setting freeCompilerArgs.add("-Xjdk-release=1.8" is not needed here become android builds are different from jvm builds
1415
}
1516
}
1617

@@ -22,7 +23,7 @@ android {
2223
namespace = "fr.acinq.secp256k1.jni"
2324

2425
defaultConfig {
25-
compileSdk = 33
26+
compileSdk = 35
2627
minSdk = 21
2728
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2829
}
@@ -34,12 +35,12 @@ android {
3435

3536
externalNativeBuild {
3637
cmake {
37-
version = "3.22.1"
38+
version = "3.31.5"
3839
path("src/main/CMakeLists.txt")
3940
}
4041
}
4142

42-
ndkVersion = "27.2.12479018"
43+
ndkVersion = "28.1.13356709"
4344

4445
afterEvaluate {
4546
tasks.withType<com.android.build.gradle.tasks.factory.AndroidUnitTest>().all {

jni/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ kotlin {
1515
explicitApi()
1616
compilerOptions {
1717
jvmTarget.set(JvmTarget.JVM_1_8)
18+
// See https://jakewharton.com/kotlins-jdk-release-compatibility-flag/ and https://youtrack.jetbrains.com/issue/KT-49746/
19+
freeCompilerArgs.add("-Xjdk-release=1.8")
1820
}
1921
}
2022

jni/jvm/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ dependencies {
3636
kotlin {
3737
compilerOptions {
3838
jvmTarget.set(JvmTarget.JVM_1_8)
39+
// See https://jakewharton.com/kotlins-jdk-release-compatibility-flag/ and https://youtrack.jetbrains.com/issue/KT-49746/
40+
freeCompilerArgs.add("-Xjdk-release=1.8")
3941
}
4042
}
4143

jni/jvm/darwin/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ plugins {
1010
kotlin {
1111
compilerOptions {
1212
jvmTarget.set(JvmTarget.JVM_1_8)
13+
// See https://jakewharton.com/kotlins-jdk-release-compatibility-flag/ and https://youtrack.jetbrains.com/issue/KT-49746/
14+
freeCompilerArgs.add("-Xjdk-release=1.8")
1315
}
1416
}
1517

jni/jvm/linux/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ plugins {
99
kotlin {
1010
compilerOptions {
1111
jvmTarget.set(JvmTarget.JVM_1_8)
12+
// See https://jakewharton.com/kotlins-jdk-release-compatibility-flag/ and https://youtrack.jetbrains.com/issue/KT-49746/
13+
freeCompilerArgs.add("-Xjdk-release=1.8")
1214
}
1315
}
1416

tests/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ kotlin {
3232
jvm {
3333
compilerOptions {
3434
jvmTarget.set(JvmTarget.JVM_1_8)
35+
// See https://jakewharton.com/kotlins-jdk-release-compatibility-flag/ and https://youtrack.jetbrains.com/issue/KT-49746/
36+
freeCompilerArgs.add("-Xjdk-release=1.8")
3537
}
3638
compilations["main"].dependencies {
3739
implementation(project(":jni:jvm:all"))

0 commit comments

Comments
 (0)