Android builds: BILLING permission is being injected (solved)

I decided to try out the extension-IAP 2.0.2 w/ Android Billing 3.0 today.

I was expecting the com.android.vending.BILLING permission to be removed from my bundle’s AndroidManifest.xml, but I’m still seeing it. I’ve double checked the AndroidManifest.xml in all of the extensions I’m using, and do not see that permission anywhere.

It gets added towards the top of the manifest.

Is there something in the build scripts injecting the permission? I’m still using 1.2.174 if that makes a difference.

https://github.com/defold/extension-iap does add the com.android.vending.BILLING permission. I don’t know how gradle works but maybe it is automatically added based on the implementation 'com.android.billingclient:billing:3.0.0'?

I wouldn’t expect it to do that, since Google says the BILLING permission has been deprecated for a while and isn’t required when you use the newer Billing libraries.

Pretty strange.

Maybe kept for compatibility reasons for the time being?

Where do they say that?

This. You can download the dependency from Googles maven repo:

https://maven.google.com/com/android/billingclient/billing/3.0.0/billing-3.0.0.aar

Rename it to .zip and unzip. Open the included AndroidManifest.xml stub and you’ll see that it includes <uses-permission android:name="com.android.vending.BILLING" />.

The manifest stub will get merged with your main manifest file when bundling.

BTW, For anyone interested in exploring different Android/Java libraries and their dependencies you can find them here: https://mvnrepository.com/artifact/com.android.billingclient/billing

3 Likes

Great find @Pkeod.

@britzl I found that messaging here : https://developer.android.com/topic/google-play-instant/instant-play-games-checklist

1 Like

Ok, yes, in 2017 a change was made to the billing library:

Embedded billing permission inside library’s manifest. It’s not necessary to add the com.android.vending.BILLING permission inside Android manifest anymore.

Previously you needed to add the permission yourself. Now it’s added automatically during the build process like I described.