feat(audience): resolve install referrer via Maven instead of bundling the AAR#794
Merged
Conversation
d8d4d0b to
4ecca14
Compare
…g the AAR Bundled AARs can't be de-duplicated by Gradle, so shipping installreferrer-2.2.aar directly caused class/version conflicts when a game pulled the same library in via another SDK. Declare it as a Maven dependency through EDM4U (Editor/ImmutableAudienceDependencies.xml) and document a manual mainTemplate.gradle fallback for projects without EDM4U. The AUDIENCE_MOBILE_ATTRIBUTION define still gates the C# JNI code; the defensive proguard keep-rules are retained. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… template The sample no longer gets the Install Referrer Library from a bundled AAR, and it doesn't use EDM4U, so it declares the Maven dependency manually in mainTemplate.gradle - the documented fallback path. Verified the resulting App Bundle includes the installreferrer classes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4ecca14 to
13e40ba
Compare
bkbooth
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Audience package bundled
installreferrer-2.2.aardirectly, and bundled AARs can't be de-duplicated by Gradle — so any game that already pulled the Google Play Install Referrer Library via another SDK hit class/version conflicts on the Android build. This swaps the bundled AAR for a Maven-resolved dependency so Gradle resolves a single highest version across all SDKs, fixing the conflict reported from customer.Changes
installreferrer-2.2.aar(+.meta).Editor/ImmutableAudienceDependencies.xmldeclaringcom.android.installreferrer:installreferrer:2.2for EDM4U's Android Resolver.mainTemplate.gradleline so EDM4U is a recommended prerequisite, not a hard requirement.examples/audiencesample (it doesn't use EDM4U), which also serves as a worked example of the fallback.proguard-user.txt(the Maven artifact is the same AAR).Notes
play-services-ads-identifier(GAID) is intentionally still studio-provided, so games not collecting the advertising ID never declareAD_ID. Unchanged.AUDIENCE_MOBILE_ATTRIBUTIONdefine still gates the C# JNI code. The Maven dependency itself is no longer define-gated (EDM4U can't read scripting defines), so non-attribution builds carry a ~8 KB permissionless unused dependency — an accepted cosmetic cost over a Unity-version-fragile Gradle-injection post-processor.Studios using
AUDIENCE_MOBILE_ATTRIBUTIONnow need either EDM4U (automatic) or the documented manual Gradle line. The package is alpha, so this is acceptable.Testing
Verified with a batchmode Android build of
examples/audience(Unity 2021.3.45f2,AUDIENCE_MOBILE_ATTRIBUTIONset, manual-fallback gradle path — no EDM4U):Dependencies.xml/.metaimport without error.installreferrer:2.2from Maven (confirmed in the manifest-merger report).InstallReferrerClient,InstallReferrerClientImpl,ReferrerDetails, …).The EDM4U auto-resolution path (
Dependencies.xml) was not exercised — this sample project has no EDM4U installed — so a reviewer with an EDM4U project should sanity-check that path.