flutter_stripe icon indicating copy to clipboard operation
flutter_stripe copied to clipboard

Misconfigured example AndroidManifest.xml causes GooglePay unavailable (fix inside)

Open pdivita opened this issue 3 years ago • 2 comments

I'm trying to enable GooglePay payments in my flutter app, following the official plugin example. Reading the AndroidMainfest.xml file, the meta-data tag that enable Google Pay

<meta-data
    android:name="com.google.android.gms.wallet.api.enabled"
    android:value="true" />

is located inside the activity tag.

This (at least for me) is not working, as calling Stripe.instance.isGooglePaySupported(IsGooglePaySupportedParams()) returns false.

Moving that block upper in the tree (that is inisde the application tag) and building again, fixed the issue.

Just to be clear I found that also the official google-pay AndroidManifest.xml put the metadata inside the application tag.

My suggestion is to update the example file and the homepage documentation.

Tested and working on my Xiaomi Mi Lite 5g with Android 11 and Emulator with Android 12.

Hope it helps

pdivita avatar Apr 06 '22 10:04 pdivita

Thanks will fix this 👍 . Also I will spend some time coming weeks in adding a bit more documentation for this part.

remonh87 avatar Apr 07 '22 19:04 remonh87

I can confirm this causes the issue, and suggested change fixes it.

canciloglu avatar May 22 '22 22:05 canciloglu