Skip to content

Comments

[in_app_purchase] Clarify billing dependency handling for Android in example README#11089

Open
khosbilegt wants to merge 4 commits intoflutter:mainfrom
khosbilegt:patch-1
Open

[in_app_purchase] Clarify billing dependency handling for Android in example README#11089
khosbilegt wants to merge 4 commits intoflutter:mainfrom
khosbilegt:patch-1

Conversation

@khosbilegt
Copy link

Clarify misleading billing setup instructions in the Android example for in_app_purchase's README.md (or rather lack of clarification).

Following the instructions of Google Play Billing documentation setup and adding the dependency in build.gradle causes Play Store connectivity issues, and must not be added.

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Add important note about common pitfall in dependency management for Google Play Billing.
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request clarifies the Android billing dependency setup in the example's README to prevent users from manually adding a conflicting dependency, which is a valuable addition. The corresponding changelog entry has a minor typo and could be more concise. I've provided a suggestion to address this.

@khosbilegt
Copy link
Author

Had to debug this for a couple hours and found the fix at https://stackoverflow.com/a/70589769/19938854.

LLMs couldn't figure it out. Thought adding it to the README, having it up on pub.dev and having it get indexed would be useful for others.

khosbilegt and others added 2 commits February 21, 2026 16:40
Accepted Gemini's suggestion for CHANGELOG

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Contributor

@bparrishMines bparrishMines left a comment

Choose a reason for hiding this comment

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

LGTM

Although it's typically implied that plugins handle native dependencies because the purpose of the plugin is to provide access to the native library, I'm not opposed to adding additional documentation if multiple people may be running into this issue as shown by the stackoverflow issue.

@stuartmorgan-g for secondary review

@stuartmorgan-g
Copy link
Collaborator

Although it's typically implied that plugins handle native dependencies because the purpose of the plugin is to provide access to the native library, I'm not opposed to adding additional documentation if multiple people may be running into this issue as shown by the stackoverflow issue.

I don't think the vote counts on the SO issue suggest that this is a widespread problem, but I think the argument there that the setup docs that plugin clients need to follow include the gradle step is a reasonable one for adding some kind of note.

Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

I think this can all be collapsed to a short bullet point under step 4 (which is about the same file):

  • Unless you are also calling Google Play Billing directly from your app's native code, you do not need to add the com.android.billingclient dependency to your gradle file. If you do have a direct dependency, make sure that you are using the same version as in_app_purchase is using internally.


> **NOTE:** The dependency snippet shown in the Google Play Billing Overview setup guide:
> ```
> implementation "com.android.billingclient:billing:$billing_version"
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should not show code that people should not add; an unfortunate number of people will copy and paste things without reading the context carefully, so including this line could increase issues.

> ```
> implementation "com.android.billingclient:billing:$billing_version"
> ```
> should not be manually added when using this plugin. The plugin already manages the billing client
Copy link
Collaborator

Choose a reason for hiding this comment

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

should not be manually added when using this plugin

This isn't fully accurate; if an application uses the billing client directly for any reason, it should be managing its dependency.

> implementation "com.android.billingclient:billing:$billing_version"
> ```
> should not be manually added when using this plugin. The plugin already manages the billing client
> dependency internally, and adding it manually may cause build conflicts or prevent the app from
Copy link
Collaborator

Choose a reason for hiding this comment

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

"may" is pretty vague here; the actual problem would arise from using an incompatible version.


### Android

> **NOTE:** The dependency snippet shown in the Google Play Billing Overview setup guide:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Google Play Billing Overview setup guide

It's not clear to me what exactly this is referencing; neither the page nor the section with the code below is called this, but its capitalized like it's a page title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants