Big Thanks for the answer.
Im plyaing with :
https://github.com/godotengine/godot-google-play-billing/tree/billing-v5
where I got the source code and I'm messing under the hood learning java and android api at the same time. I'm following the code logic and adding small changes for reply 5.1.0 billing library needs. Unfortunately I'm no coder and burn lot of time trying to understand how it works.
Anyway my gradlew build works . I can connect to play store and buy consumables at the moment. Problem showed when connection is lost between buying and consuming product.
I resolved problem temporally adding "queryPurchases()" function on callback from "onMainResume" in the plugin (which is callback Activity#onResume() ).
But I suppose beacuse "queryPurchases" is called async so I have an error : Purchase acknowlegde error: 6: ERROR Server error, please try again. "//purchase_token" after buing product. Which is irrelevant beacuse next line in logcat is "purchase acknowledged" with the same token and product can be consumed with no problem
My lack of understanding what an Activity is and what triggers "onMainResume" function in the plugin is the source of the problem.
Now after reading Your answer and making some experiments i can roughly assume and (over)simplify that from billing plugin perspective Activity "is" my application and my interaction with it. "onMainResume()" triggers everytime I switch apps on the phone or I exit the play store.
Anyway with this knowlegde effective acknowleging purchase after connection error is closer for me.
Big thanks Wakatta
p.s Here are links to godot.plugin
https://github.com/godotengine/godot/blob
/****************************************/
platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPlugin.java
Ok link is impossible. One must search on GitHub.
and Activity:
https://developer.android.com/reference/android/app/Activity
maybe someone find it helpful.
Cheers