Repository navigation
fix(android): update template to use gradle 9 - #15828
Conversation
Package Changes Through f1afdd9There are 14 changes which include tauri with minor, tauri-cli with minor, @tauri-apps/cli with minor, tauri-runtime with minor, tauri-runtime-wry with minor, tauri-utils with minor, tauri-bundler with minor, tauri-build with minor, tauri-macos-sign with minor, tauri-codegen with minor, tauri-macros with minor, tauri-plugin with minor, tauri-driver with minor, @tauri-apps/api with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
|
@FabianLars do you have the patient to verify this on an older |
…don't understand what it does
|
so basically just testing tauri-build? no errors, seems to work. |
|
Yeah.. maybe also test it in Also super confused about the |
|
yeah i see no errors in plugins-workspace either, everything seems to work correctly. after rerunning android init i can't spot the proguard error you mentioned but it may be hidden in the shitton of deprecation warnings 😅 |
|
That error only seem to appear in release build
|
|
Ok, so #6257 broke everything... It removed the This sucks so much now that all of the plugins generated before were consistently wrong that we can't really do this without some hacky work around now. 😢 |
| getByName("release") { | ||
| isMinifyEnabled = true | ||
| optimization { | ||
| enable = true |
There was a problem hiding this comment.
This also includes getDefaultProguardFile("proguard-android-optimize.txt")
7fe9f4f to
9d1a300
Compare
|
So weird that I can't reproduce this CI error locally 🤔 @FabianLars could you reproduce this error locally?
|
|
I have tested this PR against |
|
After crap ton of debugging, it might be the Edit: yeah, confirmed, it needs to be
|
Taken from the Tauri template at the commit this repo already pins for tauri itself (tauri-apps/tauri#15828). Gradle 8.14.3 → 9.6.1, AGP 8.13.2 → 9.3.1, Kotlin 2.2.0 → 2.2.10, compileSdk and targetSdk 36 → 37, and `buildSrc` rewritten the way Gradle 9 wants it: `tasks.register` instead of `maybeCreate`, and the project directory carried as an `@Input` string rather than a `File` field the configuration cache cannot serialise. What this was for is the ceiling we had already documented and stopped at: androidx `core-ktx` was held at 1.17.0 and lint's `GradleDependency` check was switched off, because 1.18+ wants compileSdk 37 and AGP 9.1. Both are back — core-ktx 1.19.0, appcompat 1.8.0, and the check enabled again. Three places deviate from the template, each for a reason: - JVM target stays 17 for our two modules where the template says 1.8. The androidx libraries they inline from are built for JVM 11, and Kotlin refuses to inline higher bytecode into lower. The Tauri modules can stay at 1.8 because inlining the other way is allowed. - the release build keeps `getDefaultProguardFile("proguard-android-optimize.txt")`, which the template dropped. This app reaches its own Kotlin from JNI and the shrinker is the one part of the build that fails silently — a class it removes shows up as a tunnel that will not start, not as a build error. Same file set as before; only the DSL changed. - two lint checks are disabled, both false for a library module read on its own: `ForegroundServicePermission`, which knows one exemption path for `systemExempted` and not ours, which is being a VpnService; and `QueryPermissionsNeeded`, which cannot see that `QUERY_ALL_PACKAGES` is declared in the app manifest and merged in. Our local `consumerProguardFiles.removeAll { !it.exists() }` workaround is gone — upstream replaced it with `android.proguard.failOnMissingFiles`.
Built on top of #15335 as a non-breaking version for v2