Skip to content

AGP 9 bump v2.0.1 - #23

Open
michelutke wants to merge 26 commits into
productionfrom
main
Open

AGP 9 bump v2.0.1#23
michelutke wants to merge 26 commits into
productionfrom
main

Conversation

@michelutke

Copy link
Copy Markdown
Collaborator

No description provided.

michelutke and others added 22 commits July 24, 2026 10:23
…and jetifier

No deprecations found in build scripts (Task 1 baseline: zero Gradle
deprecation warnings), so Step 4 of the brief is a no-op. Verification
build shows only two pre-existing source-level warnings unrelated to
Gradle/AGP (Compose menuAnchor(), Java overridePendingTransition), both
in production src/ and out of scope for this task.
… targetSdk

KMP modules (updraft-core, updraft-ui-compose) fail configuration under AGP 9
with com.android.library + kotlin.multiplatform; they migrate to the new
com.android.kotlin.multiplatform.library target plugin in follow-up commits.
AGP 9's built-in Kotlin no longer allows org.jetbrains.kotlin.multiplatform
together with com.android.application in the same module. Per Kotlin's own
AGP 9 migration guide, the prescribed fix is to extract the Android entry
point into its own application module and convert the shared code module to
the Android-KMP library plugin (com.android.kotlin.multiplatform.library).
sample/composeApp is now that shared library (androidTarget + iOS targets,
namespace com.appswithlove.updraftsdk.shared); the new sample/androidApp
module holds the app shell (manifest, MainActivity, App, launcher resources,
signing, applicationId/versionCode/versionName, build types) and depends on
composeApp and updraft-sdk.

The com.appswithlove.updraft 2.3.0 plugin is parked (commented out) in
sample/androidApp/build.gradle.kts: it casts the AGP application extension to
the removed legacy AppExtension type
("ApplicationExtensionImpl$AgpDecorated_Decorated cannot be cast to
AppExtension") and fails to apply under AGP 9. Catalog entry and root
apply-false are left intact; see TODO(#16) at the commented plugin alias to
re-enable once the plugin ships AGP 9 support.
composeMultiplatform capped at 1.10.3 instead of the planned 1.11.1:
1.11.0/1.11.1 ship iOS components-resources klibs built with a
newer Kotlin/Native ABI (2.3.0) than our pinned Kotlin 2.2.21 can
consume, breaking iosSimulatorArm64Test. 1.10.3 is the newest CMP
release that still builds, tests, and publishes cleanly on 2.2.21.
Mark AGP 9 upgrade as implemented on feature/toolchain-agp9 with the
final version set (Gradle 9.6.1, AGP 9.3.1, CMP 1.10.3, vanniktech
0.37.0, dokka 2.2.0, loco 1.2.0, androidx.startup 1.2.0, coveralls
2.12.2), sample split, and parked updraft plugin.

README Kotlin compatibility matrix verified accurate, no change needed.
The AGP 9 incompatibility only affected plugin 2.x; 3.0.0 (released
2026-01-22) requires AGP 9+ and applies cleanly. Removes the TODO(#16)
park from sample/androidApp and restores the updraft {} upload wiring.
Applied at root with no jacoco setup and no CI task invoking it, so it
produced nothing while adding a plugin to re-validate on every toolchain
bump. Resolves the 'verify or drop' item from #16.
Toolchain migration: AGP 9, Gradle 9, built-in Kotlin, plugin upgrades
michelutke and others added 4 commits September 3, 2026 14:16
View.draw into a software Canvas throws
"Software rendering doesn't support hardware bitmaps" on any Compose
screen or View tree containing a hardware bitmap, crashing the host app
on shake. Use PixelCopy on the window (API 24+, callback on a background
HandlerThread so the blocking main thread is not deadlocked), keep
View.draw as pre-24 fallback, and never let a failed capture propagate:
feedback opens without a screenshot instead.

Fixes #25
- ScreenshotGrabber.capturePng() is now a suspend fun. Android awaits
  PixelCopy via suspendCancellableCoroutine on the main looper (API 24-33)
  or PixelCopy.Request with the main executor (API 34+), 2 s timeout, and
  encodes PNG on Dispatchers.Default. The main thread is never blocked.
- Updraft.showFeedback() launches on a Main scope, ignores overlapping
  calls while a capture is in flight, and catches any Throwable from the
  grabber so a failed screenshot can never crash the host app.
- New Updraft.screenshotGrabber hook lets hosts supply their own capture,
  replacing the 1.x ScreenshotProvider.

Refs #25
Fix shake-to-feedback crash on Compose / hardware-bitmap screens (2.0.1)
@@ -0,0 +1,112 @@
# AGP 9 / Gradle 9 Toolchain Migration — Design

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

denke docs müssen wir nicht einchecken oder findest du?

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