I am getting this error testing in-app subscription products locally.
authentication is required. you need to sign in to your google account
In essence, in-app billing payments can only be tested with a release-signed apk (the one we upload to Google Play Console).
Here are some steps that got me attached to a signed apk with Android Studio:
I'm on Windows. It helps having adb.exe in the PATH, for me that's:
C:\Users{your-username}\AppData\Local\Android\sdk\platform-tools
AndroidManifest.xml under application nodeandroid:debuggable="true" tools:ignore="HardcodedDebugMode"
Note:
Propably, you need to add: xmlns:tools="http://schemas.android.com/tools" property to your manifest tag. It may look like:
And in your build.gradle file under android > buildTypes > release, add:
debuggable true
Generate a signed APK from Android Studio
Attach your device for USB debugging. Remove current install:
adb uninstall {yourdomain}.{yourpackagename}
adb install app-release.apk
Run menu, last option is "Attach debugger to Android Process" - select your device. You are now debugging.NB for in-app billing the build number needs to match the one currently published on Play Store