Crash on release when using a Test Store API key#5453
Merged
Conversation
tonidero
approved these changes
Aug 5, 2025
tonidero
left a comment
Contributor
There was a problem hiding this comment.
Oh yeah, good point, this looks good!!
JayShortway
approved these changes
Aug 5, 2025
| #else | ||
| // In release builds, we intentionally crash to prevent submitting an app with a Test Store API key | ||
| fatalError("[RevenueCat]: Test Store API key used in RELEASE build." + | ||
| "Please configure a valid API key before releasing.") |
Member
There was a problem hiding this comment.
Should we guide the dev a bit more? Maybe:
Suggested change
| "Please configure a valid API key before releasing.") | |
| "Please configure the App Store app on the RevenueCat dashboard and use its corresponding Apple API key before releasing.") |
Member
Author
There was a problem hiding this comment.
I like it! yes, it's much clearer this way 👌 Thanks!!
Done in 9257137
JayShortway
approved these changes
Aug 5, 2025
📸 Snapshot Test1 modified, 704 unchanged
🛸 Powered by Emerge Tools |
github-merge-queue Bot
pushed a commit
to RevenueCat/purchases-android
that referenced
this pull request
Aug 5, 2025
### Description Android equivalent of RevenueCat/purchases-ios#5453 This PR introduces a crash at runtime if the app is running on release (on a debuggable process) when configuring the SDK with a Test Store API Key. Debug builds are unaffected. --------- Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>
This was referenced Aug 13, 2025
tonidero
added a commit
to RevenueCat/purchases-android
that referenced
this pull request
Aug 25, 2025
### Description Android equivalent of RevenueCat/purchases-ios#5453 This PR introduces a crash at runtime if the app is running on release (on a debuggable process) when configuring the SDK with a Test Store API Key. Debug builds are unaffected. --------- Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>
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.
Motivation
Using a Test Store API Key in production will result in apps being submitted to the App Store without proper in-app purchase configuration. This would lead to a broken user experience, no proceeds being made from IAPs and, very likely, to the rejection of the app. We want to ensure these builds are caught early and prevented from reaching review.
Description
This PR introduces a crash at runtime if the app is running a Release build when configuring the SDK with a Test Store API Key. Debug builds are unaffected.
Important: XCFramework support
When the SDK is distributed as an XCFramework (binary compiled with Release configuration), the client app’s
DEBUGcompiler flag isn’t propagated into the binary. As a result, any build—including those intended as “development” when integrated via XCFramework—will crash if a Test Store API Key is used.This means that developing with a Test Store API key isn’t supported when adding the SDK dependency as an XCFramework.