Skip to content

Commit 7f1ffb3

Browse files
ADFA-4643: Remove com.sun.jna from the APK (#1577)
* ADFA-4643: Remove com.sun.jna from the APK 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> * style: Fix tab/space formatting in templates-api/build.gradle.kts 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> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 7242301 commit 7f1ffb3

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

composite-builds/build-logic/plugins/src/main/java/com/itsaky/androidide/plugins/conf/AndroidModuleConf.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ fun Project.configureAndroidModule(coreLibDesugDep: Provider<MinimalExternalModu
9797
"META-INF/CHANGES",
9898
"META-INF/README.md",
9999
"META-INF/LICENSE-notice.md",
100-
"com/sun/jna/**",
101100
),
102101
)
103102
pickFirsts.addAll(

subprojects/aaptcompiler/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ dependencies {
4040
implementation(projects.logger)
4141

4242
api(libs.aapt2.annotations)
43-
api(libs.aapt2.common)
43+
api(libs.aapt2.common) {
44+
exclude(group = "net.java.dev.jna")
45+
}
4446
api(libs.composite.layoutlibApi)
4547

4648
api(projects.subprojects.aapt2Proto)

templates-api/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ dependencies {
3535
api(projects.subprojects.xmlDom)
3636
api(projects.subprojects.xmlUtils)
3737

38-
api(libs.aapt2.common)
38+
api(libs.aapt2.common) {
39+
exclude(group = "net.java.dev.jna")
40+
}
3941
api(libs.androidx.annotation)
4042
api(libs.androidx.appcompat)
4143
api(libs.google.material)
4244

43-
implementation(libs.google.gson)
45+
implementation(libs.google.gson)
4446
}

0 commit comments

Comments
 (0)