diff --git a/.forgejo/workflows/android.yml b/.forgejo/workflows/android.yml index 08b9a8b5..cf8e28df 100644 --- a/.forgejo/workflows/android.yml +++ b/.forgejo/workflows/android.yml @@ -17,6 +17,15 @@ on: paths: - 'android/**' +env: + # Silences the JDK 22+ "restricted method in java.lang.System has been + # called" warning that Gradle 9.1's bundled native-platform jar trips + # at launch (System.load for native primitives). Affects the LAUNCHER + # JVM, not the daemon — that's why org.gradle.jvmargs in + # gradle.properties isn't enough. Future-compat: required opt-in once + # JDK 25 promotes the warning to an error. + JAVA_TOOL_OPTIONS: "--enable-native-access=ALL-UNNAMED" + jobs: build: name: Build + lint + test diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index ed07c04e..87d52cf9 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -86,6 +86,14 @@ android { kotlin { compilerOptions { jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17) + // Opt into the future Kotlin behavior: annotations on + // constructor parameters apply to both the param AND the + // generated property/field. Without this flag, Kotlin 2.x + // emits a deprecation warning at every @Inject / + // @ApplicationContext / @ApplicationScope constructor- + // parameter use. Setting it now matches what becomes the + // default in Kotlin 2.3 (KT-73255). + freeCompilerArgs.add("-Xannotation-default-target=param-property") } }