Skip to content

bump sdk, gradle and deps#585

Open
pazos wants to merge 2 commits intokoreader:masterfrom
pazos:build
Open

bump sdk, gradle and deps#585
pazos wants to merge 2 commits intokoreader:masterfrom
pazos:build

Conversation

@pazos
Copy link
Copy Markdown
Member

@pazos pazos commented Mar 5, 2026

superseedes #572


This change is Reviewable

@pazos
Copy link
Copy Markdown
Member Author

pazos commented Mar 5, 2026

bumping targetSdk is always error-prone :/

@Frenzie Frenzie mentioned this pull request Mar 5, 2026
@benoit-pierre
Copy link
Copy Markdown
Member

Try without this line first.

@benoit-pierre
Copy link
Copy Markdown
Member

The SDK version should be bumped in https://github.com/koreader/koreader-base/blob/master/toolchain/Makefile#L34, and an updated koandroid docker image need to be cut.

@pazos
Copy link
Copy Markdown
Member Author

pazos commented Mar 6, 2026

> Failed to install the following SDK components:
      build-tools;36.0.0 Android SDK Build-Tools 36
      platforms;android-36 Android SDK Platform 36
  The SDK directory is not writable (/opt/android-sdk-linux)

@benoit-pierre
Copy link
Copy Markdown
Member

For the builtin Kotlin / new DSL stuff:

--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,6 +1,5 @@
 //file:noinspection GrDeprecatedAPIUsage
 apply plugin: 'com.android.application'
-apply plugin: 'kotlin-android'
 
 android {
     namespace = 'org.koreader.launcher'
@@ -60,8 +59,10 @@ android {
         targetCompatibility = JavaVersion.VERSION_17
     }
 
-    kotlinOptions {
-        jvmTarget = '17'
+    kotlin {
+	compilerOptions {
+	    jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
+	}
     }
 
     flavorDimensions = [ 'ABI', 'CHANNEL'  ]
@@ -121,11 +122,13 @@ android {
     androidResources {
         noCompress '7z'
     }
+}
 
-    applicationVariants.configureEach { variant ->
-        variant.outputs.configureEach {
-            outputFileName = "NativeActivity.apk"
-        }
+androidComponents {
+    onVariants(selector().all()) {
+	outputs.forEach {
+	    it.outputFileName.set("NativeActivity.apk")
+	}
     }
 }
 
diff --git a/gradle.properties b/gradle.properties
index 1e55d0c..1856671 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -25,5 +25,3 @@ android.uniquePackageNames=false
 android.dependency.useConstraints=true
 android.r8.strictFullModeForKeepRules=false
 android.r8.optimizedResourceShrinking=false
-android.builtInKotlin=false
-android.newDsl=false

@benoit-pierre
Copy link
Copy Markdown
Member

Do we need all those new gradle properties? I've had success locally building and running an ARM APK with just:

org.gradle.warning.mode=all
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.configureondemand=true
org.gradle.parallel=true

# Use AndroidX compat libraries
android.useAndroidX=true

# Fallback values used in gradle build
projectName=luajit-launcher
versCode=1
versName=1.0
assetsPath=../assets
libsPath=../libs

# JNI libraries
sevenZipLib=z

# Compilation features
android.defaults.buildfeatures.shaders=false

@pazos
Copy link
Copy Markdown
Member Author

pazos commented Mar 7, 2026

oh, I saw the builtin Kotlin / new DSL stuff but I thought it was going to be hard. Do you want to commit it as part of this PR?

Do we need all those new gradle properties?

At least android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false for gh actions

@benoit-pierre
Copy link
Copy Markdown
Member

Do we need all those new gradle properties?

At least android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false for gh actions

What does that do? I can't find any documentation.

@benoit-pierre
Copy link
Copy Markdown
Member

I updated my docker image with your latest change from koreader/koreader-base#2286, and now of course the build is broken…

@benoit-pierre
Copy link
Copy Markdown
Member

I guess we would need to bump to platforms;android-36.1 too? Can't find any useful information, release notes, on SDK 36.1… Man, android development is such a shit show…

@benoit-pierre
Copy link
Copy Markdown
Member

OK, I re-tagged it to the previous version, let's forget about build-tools;36.1.0 for now. ¯\(ツ)

@benoit-pierre
Copy link
Copy Markdown
Member

Do we need all those new gradle properties?

At least android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false for gh actions

What does that do? I can't find any documentation.

It seems to build fine on GA wihout it: https://github.com/benoit-pierre/android-luajit-launcher/actions/runs/22800505004. Might be some interaction with some of those other properties…

@benoit-pierre
Copy link
Copy Markdown
Member

OK, so linked to android.dependency.useConstraints, which now default to false:

android.dependency.useConstraints

Controls the use of dependency constraints between configurations.

The default in AGP 9.0 is false which only uses constraints in application device tests (AndroidTest). Setting this to true will revert back to the 8.13 behavior. true → false Don't use dependency constraints everywhere unless you need them. Accepting the new default of this flag also enables optimizations in the project import process which should reduce the import time for builds with many Android library subprojects.

@benoit-pierre
Copy link
Copy Markdown
Member

We can get rid of android.defaults.buildfeatures.shaders=false too (false is the new default).

@benoit-pierre
Copy link
Copy Markdown
Member

And the APK seems to work fine without android.nonTransitiveRClass=false too (whose default was changed to true in AGP 8.0.0).

pazos and others added 2 commits March 7, 2026 17:04
Co-authored-by: Benoit Pierre <benoit.pierre@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants