Skip to content

enable R8 minify for release builds #1183

Open

Description

@ovitrif

Turn on R8 for Bitkit Android release builds and consume the UniFFI AARs that ship consumer keep rules.

Deliverable

  • Set isMinifyEnabled = true on the release build type.
  • Set isShrinkResources = true on the release build type.
  • Keep JNI native method names and their descriptor classes in app/proguard-rules.pro.
  • Set the Kotlin compiler flag -Xannotation-default-target=param-property.
  • Consume released bitkit-core, ldk-node, vss-client, and paykit Android artifacts that include those consumer keep rules.

Acceptance

  • A minified release build installs and exercises Lightning, on-chain, Paykit, VSS, and hardware-wallet flows.

Activity

  1. added this to the 2.5.0 milestone on Aug 26, 2026
  2. self-assigned this
    on Aug 26, 2026
  3. added theissue type on Aug 26, 2026
  4. modified the milestones: 2.5.0, 3.0.1 on Sep 7, 2026
  5. ovitrif commented on Nov 11, 2026

    @ovitrif
    CollaboratorAuthor

    Closing synonymdev/bitkit-android#1184 for now: it has been on hold since August and now conflicts with master. I'm keeping its findings here for when we pick R8 up again, closer to Feb 2027. Its branch feat/enable-r8-minify (63db291) stays on GitHub, so the PR can be reopened or its commits reused.

    What the PR found and did:

    • Turning on the AGP 9.3 optimization block for release brings in the default Android keep rules.
    • The local Bluetooth AAR and its helper JAR need their JNI types kept in app/proguard-rules.pro.
    • Once bitkit-core-android, ldk-node-android, vss-client-android and paykit-android ship UniFFI and JNA consumer rules (bitkit-core v0.5.11, ldk-node v0.7.0-rc.65, vss-rust-client-ffi v0.5.25, Paykit v0.1.0-rc49 at the time), the app-side UniFFI and JNA keeps can go.
    • The PR also set the Kotlin compiler flag -Xannotation-default-target=param-property.

    QA on a minified devRelease (API 36 ARM64 emulator, and a 16 KB page emulator):

    • Passed: launch, onboarding to Home, Lightning node start, Electrum SSL sync, trusted peer connect, VSS store id and putObject, native library loads for Paykit, bitkit-core and btleplug, hardware wallet intro and BLE scan, currency rates refresh.
    • Not yet run: Lightning and on-chain send and receive, Paykit contact payment, VSS restore on a new install, pairing a real hardware wallet and a transfer with it. These are the acceptance flows above, and need running on the next attempt.

    For the next attempt: rebase onto master, bump to the current releases of the four libraries above (check each still ships its consumer rules), run :app:analyzeDevReleaseR8Config, then the full acceptance list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions