From 7e2c4789334d83e6e02e36e669b6aee07d0cbaf5 Mon Sep 17 00:00:00 2001 From: Mas Azalya Date: Mon, 19 Oct 2026 10:48:19 +0800 Subject: [PATCH 1/2] DEV-1115 Exclude JNA from the driver on Android shimmerdriver gained net.java.dev.jna:jna and jna-platform 5.18.1 in April (97bd44ab in Shimmer-Java-Android-API) for the desktop USB debug listeners, and 0.11.8_beta onwards carries them. Android had only ever built against 0.11.7_beta, so nothing saw it until now: against 0.11.9_beta every app fails packaging with "2 files found with path 'META-INF/AL2.0'" from the two JNA jars. A release with the driver box blank would stop at "Build every example against the chosen driver". JNA is desktop-only and nothing on Android loads those classes, so exclude it, as io.netty already is. Checked locally (JDK 17): with -PdriverVersion=0.11.9_beta the release .aar and assembleDebug in all 12 modules build; with the default driver (0.11.7_beta) all 12 still build. Co-Authored-By: Claude Opus 5.5 --- ShimmerAndroidInstrumentDriver/build.gradle | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ShimmerAndroidInstrumentDriver/build.gradle b/ShimmerAndroidInstrumentDriver/build.gradle index 6592508a..10abd3f2 100644 --- a/ShimmerAndroidInstrumentDriver/build.gradle +++ b/ShimmerAndroidInstrumentDriver/build.gradle @@ -88,6 +88,9 @@ allprojects { // excluding org.json which is provided by Android exclude group: 'io.netty' exclude group: 'com.google.protobuf' + // JNA (in the driver since 0.11.8_beta) is for the desktop USB debug listeners only; on + // Android its two jars clash on META-INF/AL2.0 and fail every app's packaging. + exclude group: 'net.java.dev.jna' exclude group: 'org.apache.commons.math' } @@ -96,6 +99,9 @@ allprojects { // excluding org.json which is provided by Android exclude group: 'io.netty' exclude group: 'com.google.protobuf' + // JNA (in the driver since 0.11.8_beta) is for the desktop USB debug listeners only; on + // Android its two jars clash on META-INF/AL2.0 and fail every app's packaging. + exclude group: 'net.java.dev.jna' } } } From 62c30e6a665a208d431857b76342c2f445f17401 Mon Sep 17 00:00:00 2001 From: Mas Azalya Date: Mon, 19 Oct 2026 11:18:36 +0800 Subject: [PATCH 2/2] DEV-1115 Tell AAR consumers to exclude JNA in the release notes Excluding JNA in this repo's build.gradle does not reach apps that consume the published .aar: its POM lists no dependencies, so they add the driver themselves and would hit the same META-INF/AL2.0 clash with driver 0.11.8_beta or later. The generated notes now say to exclude net.java.dev.jna and link the exclusions this library builds with. Raised by the Copilot review on #127. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4cc22619..8d0d42b7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -287,6 +287,9 @@ jobs: { echo "Built against \`com.shimmerresearch:shimmerdriver\` and \`com.shimmerresearch:shimmerbluetoothmanager\` **$DRIVER** ([API_v$DRIVER]($driver_url)). Add both, at that version, to your app's dependencies." echo + # The driver's JNA is desktop-only; its two jars clash on META-INF/AL2.0 in an Android app. + echo "Exclude \`net.java.dev.jna\` from both, or the app fails packaging with \"2 files found with path 'META-INF/AL2.0'\". The exclusions this library builds with are in [ShimmerAndroidInstrumentDriver/build.gradle]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/blob/$TAG/ShimmerAndroidInstrumentDriver/build.gradle)." + echo gh api "repos/$GITHUB_REPOSITORY/releases/generate-notes" "${args[@]}" --jq .body } > notes.md gh release create "$TAG" release-assets/* \