Hey guys,
what to do, how to fix it?
I checked license key - it is ok. Restoring works fine.
I have this error on android after successful purchase:
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=3, result=-1, data=Intent { (has extras) }} to activity {com.elitegamesltd.royalquest/com.ansca.corona.CoronaActivity}: java.lang.IllegalArgumentException: plugin.google.iap.v3.util.Base64DecoderException: single trailing character at offset 640 at android.app.ActivityThread.deliverResults(ActivityThread.java:4221) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4264) at android.app.ActivityThread.-wrap20(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1613) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:163) at android.app.ActivityThread.main(ActivityThread.java:6383) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794) Caused by: java.lang.IllegalArgumentException: plugin.google.iap.v3.util.Base64DecoderException: single trailing character at offset 640 at plugin.google.iap.v3.util.Security.generatePublicKey(Security.java:112) at plugin.google.iap.v3.util.Security.verifyPurchase(Security.java:89) at plugin.google.iap.v3.util.IabHelper.handleActivityResult(IabHelper.java:500) at plugin.google.iap.v3.LuaLoader$5.onHandleActivityResult(LuaLoader.java:327) at com.ansca.corona.CoronaActivity.onActivityResult(CoronaActivity.java:3406) at android.app.Activity.dispatchActivityResult(Activity.java:7125) at android.app.ActivityThread.deliverResults(ActivityThread.java:4217) ... 9 more Caused by: plugin.google.iap.v3.util.Base64DecoderException: single trailing character at offset 640 at plugin.google.iap.v3.util.Base64.decode(Base64.java:559) at plugin.google.iap.v3.util.Base64.decode(Base64.java:474) at plugin.google.iap.v3.util.Base64.decode(Base64.java:420) at plugin.google.iap.v3.util.Security.generatePublicKey(Security.java:102) ... 15 more
Any ideas what I’m doing wrong?
(same code works fine for my other project).
store = require("plugin.google.iap.v3"); function storeInitHandler(event) local transaction = event.transaction; if (transaction.state == "purchased" or transaction.state == "restored") then local buy\_id = transaction.productIdentifier; buyHandlerCall(buy\_id); end end store.init(storeInitHandler); store.purchase(buy\_id);