{"action":"created","issue":{"url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/299","labels_url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/299/labels{/name}","comments_url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/299/comments","events_url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/299/events","html_url":"https://github.com/j3k0/cordova-plugin-purchase/issues/299","id":109046259,"number":299,"title":"[PGB] Android crash after successful purchase","user":{"login":"danielefenix","id":6150475,"avatar_url":"https://avatars.githubusercontent.com/u/6150475?v=3","gravatar_id":"","url":"https://api.github.com/users/danielefenix","html_url":"https://github.com/danielefenix","followers_url":"https://api.github.com/users/danielefenix/followers","following_url":"https://api.github.com/users/danielefenix/following{/other_user}","gists_url":"https://api.github.com/users/danielefenix/gists{/gist_id}","starred_url":"https://api.github.com/users/danielefenix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielefenix/subscriptions","organizations_url":"https://api.github.com/users/danielefenix/orgs","repos_url":"https://api.github.com/users/danielefenix/repos","events_url":"https://api.github.com/users/danielefenix/events{/privacy}","received_events_url":"https://api.github.com/users/danielefenix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-30T09:08:25Z","updated_at":"2015-10-08T20:18:19Z","closed_at":null,"body":"Hi everyone,\r\n\r\nI successfully installed and made the plugin work for iOS but I can not make it work with Android.\r\n\r\nI can successfully purchase an item but when Google says that the purchase is OK the app crashes and closes. If i try to open it again and call the store.refresh() method the app crashes again.\r\n\r\nAdditional information:\r\n- the app is compiled with PhoneGap Build\r\n- the cli-5.2.0  is used PhoneGap (iOS: 3.9.1  / Android: 4.1.1)\r\n- plugin version: name=\"cc.fovea.cordova.purchase\" source=\"npm\" version=\"3.11.1\"\r\n- the billing key is set as <param name=\"BILLING_KEY\" value=\"MIIBIj...\"/>\r\n- the product is well configured because I can successfully retrieve its price, title, ecc.\r\n- the issue has been experienced on several devices\r\n- #123 and #131 reference a similar problem, but given that they use a different compiling mechanism the solution can not be applied in my case (using PhoneGap Build)\r\n\r\nlogs:\r\n```\r\nE/IABUtil/Security(24158): Base64 decoding failed.\r\n\r\nD/AndroidRuntime(24158): Shutting down VM\r\n\r\nW/dalvikvm(24158): threadid=1: thread exiting with uncaught exception (group=0x416f1d40)\r\n\r\nE/AndroidRuntime(24158): FATAL EXCEPTION: main\r\n\r\nE/AndroidRuntime(24158): Process: com.xxx.xxx, PID: 24158\r\n\r\nE/AndroidRuntime(24158): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=10001, result=-1, data=Intent { (has extras) }} to activity {com.xxx.xxx/com.xxx.xxx.xxx}: java.lang.IllegalArgumentException: com.smartmobilesoftware.util.Base64DecoderException: Bad Base64 input character at 4: 46(decimal)\r\n\r\nE/AndroidRuntime(24158): at android.app.ActivityThread.deliverResults(ActivityThread.java:3432)\r\n\r\nE/AndroidRuntime(24158): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3475)\r\n\r\nE/AndroidRuntime(24158): at android.app.ActivityThread.access$1300(ActivityThread.java:139)\r\n\r\nE/AndroidRuntime(24158): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1258)\r\n\r\nE/AndroidRuntime(24158): at android.os.Handler.dispatchMessage(Handler.java:102)\r\n\r\nE/AndroidRuntime(24158): at android.os.Looper.loop(Looper.java:136)\r\n\r\nE/AndroidRuntime(24158): at android.app.ActivityThread.main(ActivityThread.java:5086)\r\n\r\nE/AndroidRuntime(24158): at java.lang.reflect.Method.invokeNative(Native Method)\r\n\r\nE/AndroidRuntime(24158): at java.lang.reflect.Method.invoke(Method.java:515)\r\n\r\nE/AndroidRuntime(24158): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)\r\n\r\nE/AndroidRuntime(24158): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)\r\n\r\nE/AndroidRuntime(24158): at dalvik.system.NativeStart.main(Native Method)\r\n\r\nE/AndroidRuntime(24158): Caused by: java.lang.IllegalArgumentException: com.smartmobilesoftware.util.Base64DecoderException: Bad Base64 input character at 4: 46(decimal)\r\n\r\nE/AndroidRuntime(24158): at com.smartmobilesoftware.util.Security.generatePublicKey(Security.java:70)\r\n\r\nE/AndroidRuntime(24158): at com.smartmobilesoftware.util.Security.verifyPurchase(Security.java:47)\r\n\r\nE/AndroidRuntime(24158): at com.smartmobilesoftware.util.IabHelper.handleActivityResult(IabHelper.java:497)\r\n\r\nE/AndroidRuntime(24158): at com.smartmobilesoftware.inappbilling.InAppBillingPlugin.onActivityResult(InAppBillingPlugin.java:421)\r\n\r\nE/AndroidRuntime(24158): at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:120)\r\n\r\nE/AndroidRuntime(24158): at org.apache.cordova.CordovaActivity.onActivityResult(CordovaActivity.java:353)\r\n\r\nE/AndroidRuntime(24158): at android.app.Activity.dispatchActivityResult(Activity.java:5446)\r\n\r\nE/AndroidRuntime(24158): at android.app.ActivityThread.deliverResults(ActivityThread.java:3428)\r\n\r\nE/AndroidRuntime(24158): ... 11 more\r\n\r\nE/AndroidRuntime(24158): Caused by: com.smartmobilesoftware.util.Base64DecoderException: Bad Base64 input character at 4: 46(decimal)\r\n\r\nE/AndroidRuntime(24158): at com.smartmobilesoftware.util.Base64.decode(Base64.java:518)\r\n\r\nE/AndroidRuntime(24158): at com.smartmobilesoftware.util.Base64.decode(Base64.java:446)\r\n\r\nE/AndroidRuntime(24158): at com.smartmobilesoftware.util.Base64.decode(Base64.java:392)\r\n\r\nE/AndroidRuntime(24158): at com.smartmobilesoftware.util.Security.generatePublicKey(Security.java:60)\r\n\r\nE/AndroidRuntime(24158): ... 18 more\r\n\r\nI/SFPerfTracer(  236):      triggers: (rate: 100:2571) (compose: 0:44) (post: 0:187) (render: 0:187) (149:38557 frames) (150:114101)\r\n\r\nD/SFPerfTracer(  236):        layers: (6:11) (DimLayer: 0:61)* (DimLayer: 0:23)* (FocusedStackFrame: 0:1487)* (StatusBar: 0:18582) (NavigationBar: 0:8159) (com.android.systemui.ImageWallpaper: 0:1254)* (DimLayer: 0:120) (DimLayer: 0:58)* (com.xxx.xxx/com.xxx.xxx.xxx: 0:66) (com.xxx.xxx/com.xxx.xxx.xxx: 150:2278) (com.android.vending/com.google.android.finsky.billing.lightpurchase.IabV3Activity: 24:550) \r\n\r\nW/ActivityManager(  861):   Force finishing activity com.xxx.xxx/.xxx\r\n\r\nW/ContextImpl( 1349): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1252 android.content.ContextWrapper.sendBroadcast:365 com.motorola.motocare.util.TriggerHelper$TriggerBuilder.send:76 com.motorola.motocare.internal.frameworkevents.PauseResumeTrigger.handleFrameworkEvent:53 com.motorola.motocare.internal.frameworkevents.FwEventMonitor$FrameworkListener.processFrameworkEvent:114 \r\n\r\nI/SFPerfTracer(  236):      triggers: (rate: 0:0) (36617 sw vsyncs) (0 skipped) (401:130839 vsyncs) (403:198875)\r\n\r\nD/Checkin (15389): publish the event [tag = MOT_MEDIA_STATS_L3 event name = FILE_DOWNLOAD]\r\n\r\nV/NQFileLogger(25272): [2377] e.a: about to write to file\r\n\r\nV/ProcessReports(25272): [2377] ProcessReportsService.a: If not already scheduled, schedule for 3600 to 14400 seconds from now (but might be processed inline after 900 seconds instead)\r\n\r\nI/DownloadManager(15389): Download 114 finished with status SUCCESS\r\n\r\nI/openssl (15389): Crypto mode not selected, openssl will run on its regular mode.\r\n\r\nI/openssl (15389): Crypto mode 0 already enabled\r\n\r\nD/dalvikvm(24600): GC_EXPLICIT freed 607K, 41% free 10305K/17216K, paused 1ms+3ms, total 42ms\r\n\r\nI/Gmail   (24600): MainSyncRequestProto: lowestBkwdConvoId: 0, highestHandledServerOp: 17983, normalSync: true\r\n\r\nI/Gmail   (24600): lowestBackward conversation id 0\r\n\r\nD/WifiStateMachine(  861): handleMessage: E msg.what=151572\r\n\r\nD/WifiStateMachine(  861): processMsg: ConnectedState\r\n\r\nD/WifiStateMachine(  861): processMsg: L2ConnectedState\r\n\r\nD/WifiStateMachine(  861): handleMessage: X\r\n\r\nI/Gmail   (24600): notifyAccountChanged\r\n\r\nI/Gmail   (24600): getAccountsCursor\r\n\r\nW/ActivityManager(  861): Activity pause timeout for ActivityRecord{42146178 u0 com.xx.xxx/.xxx t122 f}\r\n\r\nW/ContextImpl( 1349): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1252 android.content.ContextWrapper.sendBroadcast:365 com.motorola.motocare.util.TriggerHelper$TriggerBuilder.send:76 com.motorola.motocare.internal.frameworkevents.PauseResumeTrigger.handleFrameworkEvent:53 com.motorola.motocare.internal.frameworkevents.FwEventMonitor$FrameworkListener.processFrameworkEvent:114 \r\n\r\nI/openssl (15389): Crypto mode not selected, openssl will run on its regular mode.\r\n\r\nI/openssl (15389): Crypto mode 0 already enabled\r\n\r\nW/Settings(24328): Setting bugreport_in_power_menu has moved from android.provider.Settings.Secure to android.provider.Settings.Global.\r\n\r\nE/Cryptfs (  223): not running with encryption, aborting\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/comments/146674350","html_url":"https://github.com/j3k0/cordova-plugin-purchase/issues/299#issuecomment-146674350","issue_url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/299","id":146674350,"user":{"login":"Alveoli","id":8811975,"avatar_url":"https://avatars.githubusercontent.com/u/8811975?v=3","gravatar_id":"","url":"https://api.github.com/users/Alveoli","html_url":"https://github.com/Alveoli","followers_url":"https://api.github.com/users/Alveoli/followers","following_url":"https://api.github.com/users/Alveoli/following{/other_user}","gists_url":"https://api.github.com/users/Alveoli/gists{/gist_id}","starred_url":"https://api.github.com/users/Alveoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alveoli/subscriptions","organizations_url":"https://api.github.com/users/Alveoli/orgs","repos_url":"https://api.github.com/users/Alveoli/repos","events_url":"https://api.github.com/users/Alveoli/events{/privacy}","received_events_url":"https://api.github.com/users/Alveoli/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T20:18:19Z","updated_at":"2015-10-08T20:18:19Z","body":"Hi, I have exactly the same problem - crash after successful purchase, and now crashes every time on opening the app.  cc.fovea.cordova.purchase@4.0.0  Incidentally I am using Meteor.\r\n\r\nError message is: `E/AndroidRuntime(12713): java.lang.IllegalArgumentException: com.smartmobilesoftware.util.Base64DecoderException: Bad Base64 input character at 0: 36(decimal)`\r\n\r\nHave you found any solutions?"}}