ADFA-4643: Remove com.sun.jna from the APK#1577
Conversation
com.android.tools:common pulls in net.java.dev.jna transitively via jna-platform, purely for a macOS-only Rosetta/x86-emulation detector (ComputerArchUtilsKt.computeIsRosetta()) that's gated behind an os.name check unreachable on Android. Exclude the jna group where aapt2-common is depended on to drop it from the APK, and remove the now-redundant com/sun/jna packaging exclude. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Spotless ratchet pulled in this file's existing 4-space indentation after ADFA-4643 touched it. Auto-fixed by spotlessApply. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
📝 Walkthrough
WalkthroughThe change excludes the JNA dependency group from ChangesJNA dependency and packaging alignment
Estimated code review effort: 1 (Trivial) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
com.sun.jnaisn't a direct dependency — it's pulled in transitively viacom.android.tools:common:31.2.2(depended on asapi(libs.aapt2.common)intemplates-apiandsubprojects/aaptcompiler), throughjna-platform.commonisComputerArchUtilsKt.computeIsRosetta(), a macOS-only Rosetta/x86-emulation detector gated behind anos.namecheck that's unreachable on Android (os.nameis always"Linux"there) — confirmed by decompiling the class.net.java.dev.jnaon theaapt2-commondependency in both consuming modules, and removes the now-redundantcom/sun/jna/**packaging exclude.Test plan
dependencyInsightconfirmsnet.java.dev.jnais fully gone from:app's runtime classpathcompileV8DebugKotlinsucceeds foraaptcompiler,templates-api,templates-impl,appaaptcompilerandtemplates-api:app:assembleV8Debugsucceedscom/sun/jnaclasses🤖 Generated with Claude Code