Skip to content

Load Samsung IAP aar from libs Directory#2953

Merged
fire-at-will merged 4 commits into
samsung-devfrom
load-aar-from-directory
Dec 19, 2025
Merged

Load Samsung IAP aar from libs Directory#2953
fire-at-will merged 4 commits into
samsung-devfrom
load-aar-from-directory

Conversation

@fire-at-will

@fire-at-will fire-at-will commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Description

This PR switches the Samsung IAP library loading mechanism from a local.properties path dependency to a relative directory lookup. This ensures that the Samsung SDK is correctly resolved when building the SDK or purchase-tester.

To add the Samsung SDK to the RevenueCat SDK:

  1. Clone the samsung-dev branch of purchases-android
  2. Place the Samsung IAP SDK's aar file in the purchases-android/libs directory

This is likely not the final iteration of how we will include the Samsung SDK with the RC SDK, but it unblocks apps that want to try out the dev branch as it stands today.

@fire-at-will fire-at-will requested a review from a team as a code owner December 18, 2025 15:16
@fire-at-will fire-at-will changed the title Load Samsung IAP aar from directory Load Samsung IAP aar from Specific Directory Dec 18, 2025
Comment thread feature/galaxy/build.gradle.kts Outdated
fire-at-will and others added 2 commits December 19, 2025 07:40
Co-authored-by: JayShortway <29483617+JayShortway@users.noreply.github.com>
Comment thread feature/galaxy/build.gradle.kts Outdated
implementation(project(":purchases"))

implementation(files(samsungIapSdkPath))
compileOnly(files(samsungIapAar))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am very surprised this works since google says compileonly doesn't work with aars

https://developer.android.com/build/dependencies#dependency_configurations

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting...I have it working, but they very clearly state that it won't work with AARs. Trying to see if there's a workaround

@fire-at-will fire-at-will Dec 19, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vegaro in 7506564, I've modified this to still use compileOnly, but now instead of loading the AAR directly in from a file, it loads it from a flatDir repo, which Codex says gets around compileOnly's "no AAR" requirement 😅

It also modifies Gradle to look for the Samsung SDK in the purchases-android/libs/ folder, instead of the parent directory that contains purchases-android.

I've tested this out in the separate test app and can confirm that it works. Let me know what you think!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for future reference, when using aars even with implementation the consuming application still needs to include it, since our own aar won't include our aar dependency (unless it's a fat aar)

So I think that's mainly why Google states that?

@fire-at-will fire-at-will changed the title Load Samsung IAP aar from Specific Directory Load Samsung IAP aar from libs Directory Dec 19, 2025
@fire-at-will fire-at-will requested a review from vegaro December 19, 2025 17:55
@fire-at-will

Copy link
Copy Markdown
Contributor Author

Got verbal approval from @vegaro via a Slack DM, going to go ahead and merge

@fire-at-will fire-at-will merged commit 60f97a3 into samsung-dev Dec 19, 2025
4 of 19 checks passed
@fire-at-will fire-at-will deleted the load-aar-from-directory branch December 19, 2025 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants