Load Samsung IAP aar from libs Directory#2953
Conversation
Co-authored-by: JayShortway <29483617+JayShortway@users.noreply.github.com>
| implementation(project(":purchases")) | ||
|
|
||
| implementation(files(samsungIapSdkPath)) | ||
| compileOnly(files(samsungIapAar)) |
There was a problem hiding this comment.
I am very surprised this works since google says compileonly doesn't work with aars
https://developer.android.com/build/dependencies#dependency_configurations
There was a problem hiding this comment.
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
There was a problem hiding this comment.
@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!
There was a problem hiding this comment.
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?
|
Got verbal approval from @vegaro via a Slack DM, going to go ahead and merge |
Description
This PR switches the Samsung IAP library loading mechanism from a
local.propertiespath 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:
samsung-devbranch ofpurchases-androidaarfile in thepurchases-android/libsdirectoryThis 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.