plugin.google.iap.billing (native build) crash

Our App will crash, we are right now change the billing Plugin from:
“plugin.google.iap.v3” to “plugin.google.iap.billing”

(plugin “plugin.google.iap.v3” everything was working fine)

Our Project is a native build. That means we are added the JAR file in the Android libs:
“plugin.google.iap.billing.jar” and delete the old one.
(https://github.com/coronalabs/com.coronalabs-plugin.google.iap.billing)

and added the dependency notation “com.android.billingclient:billing:3.0.1” in the gradle build file.

App starts and on the first press on an offer the plugin will work perfectly. The native buy-layer will popup with the correct price and the shopItem is buyable.

But on second press, same product-id and the triggers same function the app is crashing.

SOLAR2D CODE:

local store = require( "plugin.google.iap.billing" )
local function onPressBuy(storeProductId,isSubscription)
      print("playstorePreBuyPurchaseManager > onPressBuy - storeProductId:", storeProductId , " isSubscription:", isSubscription)
      if isSubscription==true then
          store.purchaseSubscription(storeProductId)
      else
          store.purchase(storeProductId) -- Code-Line: 130
      end
end

NATIVE LOG:

---- PRESS BUY First Time
2021-04-20 17:22:41.514 11133-11598/? I/Corona: onPressBuy storeProductId:	offer_99_playstore	 isSubscription:	false

---- HERE THE NATIVE BUY CONTEXT IS VISIBLE (Close Window without or with buy shop-item)

---- PRESS BUY Second Time

2021-04-20 17:23:06.307 11133-11598/? I/Corona: onPressBuy storeProductId:	offer_99_playstore	 isSubscription:	false
2021-04-20 17:23:06.311 11133-11598/? I/Corona: src/manager/playstorePreBuyPurchaseManager.lua:130: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference
    Java Stack Trace:
    	com.android.billingclient.api.BillingClientImpl.launchBillingFlow(com.android.billingclient:billing@@3.0.1:225)
    	plugin.google.iap.billing.LuaLoader.purchaseType(LuaLoader.java:360)
    	plugin.google.iap.billing.LuaLoader.purchase(LuaLoader.java:401)
    	plugin.google.iap.billing.LuaLoader.access$1700(LuaLoader.java:39)
    	plugin.google.iap.billing.LuaLoader$PurchaseWrapper.invoke(LuaLoader.java:577)
    	com.naef.jnlua.LuaState.lua_pcall(Native Method)
    	com.naef.jnlua.LuaState.call(LuaState.java:564)
    	com.ansca.corona.CoronaLua.dispatchEvent(CoronaLua.java:140)
    	network.NetworkRequest$LuaCallback$1.executeUsing(NetworkRequest.java:612)
    	com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:179)
    	com.ansca.corona.events.EventManager.sendEvents(EventManager.java:100)
    	com.ansca.corona.Controller.updateRuntimeState(Controller.java:319)
    	com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:434)
    	com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1625)
    	com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1380)
        at purchase (External Function)
        at onPressBuy (/Users/kkk/app/Corona/src/manager/playstorePreBuyPurchaseManager.lua:130)
        at onResultCallback (/Users/kkk/app/Corona/src/manager/playstorePreBuyPurchaseManager.lua:175)
        at (Unknown Function) (/Users/kkk/app/Corona/src/manager/apiManager.lua:174)

Hi an update we just updated to the newest Plugin-Version:


This is the result:

We tested at first this Android-Billing-Versions:
"com.android.billingclient:billing:3.0.1"
"com.android.billingclient:billing:3.0.3"

Frist Payment was working Fine -
Second Payment is not working, this error was thrown:

2021-06-11 12:41:44.895 3345-3623/? I/Corona: /Corona/src/manager/playstorePreBuyPurchaseManager.lua:127: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference
    Java Stack Trace:
    	com.android.billingclient.api.BillingClientImpl.launchBillingFlow(com.android.billingclient:billing@@3.0.3:51)
    	plugin.google.iap.billing.LuaLoader.purchaseType(LuaLoader.java:397)
    	plugin.google.iap.billing.LuaLoader.purchase(LuaLoader.java:438)
    	plugin.google.iap.billing.LuaLoader.access$1700(LuaLoader.java:41)
    	plugin.google.iap.billing.LuaLoader$PurchaseWrapper.invoke(LuaLoader.java:614)
    	com.naef.jnlua.LuaState.lua_pcall(Native Method)
    	com.naef.jnlua.LuaState.call(LuaState.java:564)
    	com.ansca.corona.CoronaLua.dispatchEvent(CoronaLua.java:140)
    	network.NetworkRequest$LuaCallback$1.executeUsing(NetworkRequest.java:612)
    	com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:179)
    	com.ansca.corona.events.EventManager.sendEvents(EventManager.java:100)
    	com.ansca.corona.Controller.updateRuntimeState(Controller.java:319)
    	com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:434)
    	com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1625)
    	com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1380)
        at purchase (External Function)
        at onPreBuyCallComplete (src/manager/playstorePreBuyPurchaseManager.lua:127)
        at onResultCallback (src/manager/playstorePreBuyPurchaseManager.lua:172)
        at (Unknown Function) (src/manager/apiManager.lua:174)

Next Try was to update to the newest Android-Billing-Version:

"com.android.billingclient:billing:4.0.0"

First Payment will be crash directly:

2021-06-11 12:28:46.987 31494-31672/? E/AndroidRuntime: FATAL EXCEPTION: GLThread 3239
    Process: de.xxxx.xxxxxx, PID: 31494
    java.lang.NoSuchMethodError: No virtual method getSku()Ljava/lang/String; in class Lcom/android/billingclient/api/Purchase; or its super classes (declaration of ‘com.android.billingclient.api.Purchase’ appears in /data/app/~~RmBBBZLJN0c4LvIqWr9ubQ==/de.whow.jackpot-3jUPCl57iS379-F_BtlgRA==/base.apk)
        at plugin.google.iap.billing.StoreTransactionRuntimeTask.executeUsing(StoreTransactionRuntimeTask.java:83)
        at com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:179)
        at com.ansca.corona.events.EventManager.sendEvents(EventManager.java:100)
        at com.ansca.corona.Controller.updateRuntimeState(Controller.java:319)
        at com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:434)
        at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1625)
        at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1380)