5

I'm trying out the in_app_purchase, and everything works so far (even with test license and test buy), except consumables.

When I try to mark the IAP as consumable, then the developer console tells me the following:

"Billing library version 4.0+ is required to use this feature"

I've declared in pubspec.yaml dependencies

in_app_purchase: ^3.0.7

and also tested ^3.0.6

I've also set up android/src/main/AndroidManifest.xml with the following code snippets:

...
    <uses-permission android:name="com.android.vending.BILLING" />
...
        <meta-data
            android:name="com.google.android.play.billingclient.version"
            android:value="5.0.0" />
...

I'm only using internal testing track.

What might be the possible reasons?

  1. Is it an merchant account problem?
  2. Might it be a play console problem?
  3. Did I forgot something in my project?

Thank you in advance for your help

Keey
  • 199
  • 1
  • 15
  • Similar (not exactly duplicate) question here: https://stackoverflow.com/questions/11068686/this-version-of-the-application-is-not-configured-for-billing-through-google-pla?rq=1 – TarHalda Sep 08 '22 at 17:58
  • 2
    `in_app_purchase` is using `Google Play Billing Library 3.0` for now and there is an open issue on github about this. issue link https://github.com/flutter/flutter/issues/107370 – Mohammed Alfateh Sep 09 '22 at 13:56
  • Same error `We've detected this app uses an unsupported version of Play billing. Please upgrade to Billing Library version 4 or newer to publish this app.` in my Google Play Console.Any workaround for this now? – leegor Sep 09 '22 at 15:39
  • A user on github has apparently fixed the issue by updating the plugin and invalidating the gradle cache. Here is [his comment](https://github.com/flutter/flutter/issues/107370#issuecomment-1242648875) – jraufeisen Sep 13 '22 at 07:54
  • you can modify library by your self clone repository and add to your project as module and use after changes you want – MohitJadav86 Sep 13 '22 at 10:03

2 Answers2

2

I had the same problem. Here is what worked for me:

  • remove pubspec.lock
  • run flutter pub get

Reason why this worked:

in_app_purchase has a dependecy in_app_purchase_android which was locked in my pubspec.lock to a version that was still using Google Play Billing Library 3.0. Removing pubspec.lock and running flutter pub get fetched the latest version of in_app_purchase_android which uses Google Play Billing Library 5.0.

Philipp S.
  • 21
  • 3
0

Add the Google Play Billing Library dependency to your app's build.gradle file as shown:

dependencies {
    val billing_version = "5.0.0"

    implementation("com.android.billingclient:billing:$billing_version")
}
Zumatra Hia
  • 65
  • 1
  • 5