IAP test transaction returns all states

Hi,

I call a function from my app:

local b = iap.buyCategory(cat.categoryID)

buyCategory:

function iap.buyCategory(catID) store.init(transactionListener) if store.isActive then --store.purchase({path.."category-"..catID}) store.purchase({"android.test.purchased"}) else end display.newText( status, 28, 100, 300, 200, "Quicksand-Regular", 32 ) return status end

Transaction listener:

function transactionListener(event) if event.transaction.state == "purchased" then status = "purchased" elseif event.transaction.state == "cancelled" then status = "cancelled" elseif event.transaction.state == "failed" then status = "failed" else status = "other" end store.finishTransaction( event.transaction ) end

Before I had print statement and it printed out all the transaction states.

I don’t understand how it can return the other states. I’m using the Android test purchase so it should always return “purchased”, right?

On the device it says that the purchase has been done.

Best regards,

Tomas

It’s hard to tell looking at your code, and I doubt this is the cause, but you really should not be calling init for every purchase.  Call it once at the beginning of the code.

I would consider printing out the entire event table at the top of the listener function to see what’s really being returned.  You can grab the print_r function out of the community code (my personal fav table printer) or google around for other variants.

Rob

Hi Rob,

here is the store file:

local iap = {} local sqlite = require("sqlite") local path = "com.jefecitostudios.guessword." local store = require( "store" ) local util = require("util") store.init(transactionListener) local status = "" function iap.buyCategory(catID) print("iap.butCategory") if store.isActive then --store.purchase({path.."category-"..catID}) print("store.isActive") store.purchase({"android.test.purchased"}) else end display.newText( status, 28, 100, 300, 200, "Quicksand-Regular", 32 ) return status end function transactionListener(event) util.print\_r(event) if event.transaction.state == "purchased" then status = "purchased" print("status: purchased") elseif event.transaction.state == "cancelled" then status = "cancelled" print("status: cancelled") elseif event.transaction.state == "failed" then status = "failed" print("status: failed") else status = "other" print("status: other") end print("store.finishTransaction") store.finishTransaction( event.transaction ) end return iap

Some info from ADB:

I/Corona (22236): store.isActive D/dalvikvm(22236): GC\_FOR\_ALLOC freed 29K, 43% free 14883K/25900K, paused 19ms, total 19ms I/dalvikvm-heap(22236): Grow heap (frag case) to 18.881MB for 685816-byte allocation D/Finsky (28852): [25023] InAppBillingUtils.getPreferredAccount: com.gmail.tomaswesterlund.SpaPicV4: Account from first account - [OYjD1hSOGCbIBg5S6bhr0J3B3aU] D/Finsky (28852): [25023] InAppBillingUtils.getPreferredAccount: com.gmail.tomaswesterlund.SpaPicV4: Account from first account - [OYjD1hSOGCbIBg5S6bhr0J3B3aU] E/Parcel ( 694): Class not found when unmarshalling: com.google.android.finsky.billing.lightpurchase.PurchaseParams E/Parcel ( 694): java.lang.ClassNotFoundException: com.google.android.finsky.billing.lightpurchase.PurchaseParams E/Parcel ( 694): at java.lang.Class.classForName(Native Method) E/Parcel ( 694): at java.lang.Class.forName(Class.java:204) E/Parcel ( 694): at java.lang.Class.forName(Class.java:169) E/Parcel ( 694): at android.os.Parcel.readParcelableCreator(Parcel.java:2091) E/Parcel ( 694): at android.os.Parcel.readParcelable(Parcel.java:2055) E/Parcel ( 694): at android.os.Parcel.readValue(Parcel.java:1971) E/Parcel ( 694): at android.os.Parcel.readMapInternal(Parcel.java:2255) E/Parcel ( 694): at android.os.Bundle.unparcel(Bundle.java:223) E/Parcel ( 694): at android.os.Bundle.getString(Bundle.java:1082) E/Parcel ( 694): at android.content.Intent.getStringExtra(Intent.java:4945) E/Parcel ( 694): at com.android.server.am.ActivityStack.startActivityLocked(ActivityStack.java:3745) E/Parcel ( 694): at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:4961) E/Parcel ( 694): at com.android.server.am.ActivityManagerService.startActivityInPackage(ActivityManagerService.java:3376) E/Parcel ( 694): at com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:254) E/Parcel ( 694): at com.android.server.am.ActivityManagerService.startActivityIntentSender(ActivityManagerService.java:3268) E/Parcel ( 694): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:258) E/Parcel ( 694): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2113) E/Parcel ( 694): at android.os.Binder.execTransact(Binder.java:388) E/Parcel ( 694): at dalvik.system.NativeStart.run(Native Method) E/Parcel ( 694): Caused by: java.lang.NoClassDefFoundError: com/google/android/finsky/billing/lightpurchase/PurchaseParams E/Parcel ( 694): ... 19 more

So it’s printing “store.isActive” which means it’s inside iap.buyCategory and launches store.purchase({“android.test.purchased”}) however it does not print out any status. (“Status: purchased” etc.)

This page, http://www.basic4ppc.com/android/forum/threads/inappbilling-library-android-market-in-app-billing-service.14609/, says:

@canalrun, this error will only happen with the test keys. The test messages are not properly signed.
From my experience it is easier (and more reliable) to create some real low cost products and test them.

I also found this post: http://stackoverflow.com/questions/13814958/error-while-retrieving-information-from-the-server-rpcs-7aec-0-in-google-play

And did these steps:

Check if you are using latest version of Google Play.

_ OR _

Following the steps below.

RPC:AEC:0 error is known as CPU/RAM/Device/Identity failure.

Only possible way you can follow to get rid off this error is,

Go to settings >application > Play Store >Clear Data & Clear Cache.

Go to accounts >Google >Remove account.

Reboot device.

Again Settings>Account >Google >Log In.

With no success.

Later I updated all updates possible from Android SDK but got the same error messages again (“Class not found when unmarshalling: com.google.android.finsky.billing.lightpurchase.PurchaseParams”)

I feel a little bit lost with this problem and I have no idea how to proceed. Any help is highly appreciated!

Best regards,

Tomas

Google is throwing an error:

Class not found when unmarshalling: com.google.android.finsky.billing.lightpurchase.PurchaseParams

I googled the error and found this on StackOverflow:

http://stackoverflow.com/questions/13814958/error-while-retrieving-information-from-the-server-rpcs-7aec-0-in-google-play

You can try some of the things in the StackOverlow post, but I guess my first question is this:  Are you testing using your developer account?  Google Play does not let you use your developer account for any e-commerce with your own apps.  You probably can’t even test the test purchases.

Rob

Hi Rob,

I’m using the debug key and uploads the APK directly to my device through a cable.

The Google Play popups and I buy the product with a fake VISA. store.isActive is being printed out but nothing from the transactionListener.

Best regards,

Tomas

Are you logged into Google Play on your device with your registered developer account or a test account?

Are you testing using your developer account?

Note to self: Read everything twice before answering!

Hi Rob,

Yes, I’m using my Developer account. I will try and use another GMail account and see what’s happen!

Thanks!

Best regards,

Tomas

It’s hard to tell looking at your code, and I doubt this is the cause, but you really should not be calling init for every purchase.  Call it once at the beginning of the code.

I would consider printing out the entire event table at the top of the listener function to see what’s really being returned.  You can grab the print_r function out of the community code (my personal fav table printer) or google around for other variants.

Rob

Hi Rob,

here is the store file:

local iap = {} local sqlite = require("sqlite") local path = "com.jefecitostudios.guessword." local store = require( "store" ) local util = require("util") store.init(transactionListener) local status = "" function iap.buyCategory(catID) print("iap.butCategory") if store.isActive then --store.purchase({path.."category-"..catID}) print("store.isActive") store.purchase({"android.test.purchased"}) else end display.newText( status, 28, 100, 300, 200, "Quicksand-Regular", 32 ) return status end function transactionListener(event) util.print\_r(event) if event.transaction.state == "purchased" then status = "purchased" print("status: purchased") elseif event.transaction.state == "cancelled" then status = "cancelled" print("status: cancelled") elseif event.transaction.state == "failed" then status = "failed" print("status: failed") else status = "other" print("status: other") end print("store.finishTransaction") store.finishTransaction( event.transaction ) end return iap

Some info from ADB:

I/Corona (22236): store.isActive D/dalvikvm(22236): GC\_FOR\_ALLOC freed 29K, 43% free 14883K/25900K, paused 19ms, total 19ms I/dalvikvm-heap(22236): Grow heap (frag case) to 18.881MB for 685816-byte allocation D/Finsky (28852): [25023] InAppBillingUtils.getPreferredAccount: com.gmail.tomaswesterlund.SpaPicV4: Account from first account - [OYjD1hSOGCbIBg5S6bhr0J3B3aU] D/Finsky (28852): [25023] InAppBillingUtils.getPreferredAccount: com.gmail.tomaswesterlund.SpaPicV4: Account from first account - [OYjD1hSOGCbIBg5S6bhr0J3B3aU] E/Parcel ( 694): Class not found when unmarshalling: com.google.android.finsky.billing.lightpurchase.PurchaseParams E/Parcel ( 694): java.lang.ClassNotFoundException: com.google.android.finsky.billing.lightpurchase.PurchaseParams E/Parcel ( 694): at java.lang.Class.classForName(Native Method) E/Parcel ( 694): at java.lang.Class.forName(Class.java:204) E/Parcel ( 694): at java.lang.Class.forName(Class.java:169) E/Parcel ( 694): at android.os.Parcel.readParcelableCreator(Parcel.java:2091) E/Parcel ( 694): at android.os.Parcel.readParcelable(Parcel.java:2055) E/Parcel ( 694): at android.os.Parcel.readValue(Parcel.java:1971) E/Parcel ( 694): at android.os.Parcel.readMapInternal(Parcel.java:2255) E/Parcel ( 694): at android.os.Bundle.unparcel(Bundle.java:223) E/Parcel ( 694): at android.os.Bundle.getString(Bundle.java:1082) E/Parcel ( 694): at android.content.Intent.getStringExtra(Intent.java:4945) E/Parcel ( 694): at com.android.server.am.ActivityStack.startActivityLocked(ActivityStack.java:3745) E/Parcel ( 694): at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:4961) E/Parcel ( 694): at com.android.server.am.ActivityManagerService.startActivityInPackage(ActivityManagerService.java:3376) E/Parcel ( 694): at com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:254) E/Parcel ( 694): at com.android.server.am.ActivityManagerService.startActivityIntentSender(ActivityManagerService.java:3268) E/Parcel ( 694): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:258) E/Parcel ( 694): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2113) E/Parcel ( 694): at android.os.Binder.execTransact(Binder.java:388) E/Parcel ( 694): at dalvik.system.NativeStart.run(Native Method) E/Parcel ( 694): Caused by: java.lang.NoClassDefFoundError: com/google/android/finsky/billing/lightpurchase/PurchaseParams E/Parcel ( 694): ... 19 more

So it’s printing “store.isActive” which means it’s inside iap.buyCategory and launches store.purchase({“android.test.purchased”}) however it does not print out any status. (“Status: purchased” etc.)

This page, http://www.basic4ppc.com/android/forum/threads/inappbilling-library-android-market-in-app-billing-service.14609/, says:

@canalrun, this error will only happen with the test keys. The test messages are not properly signed.
From my experience it is easier (and more reliable) to create some real low cost products and test them.

I also found this post: http://stackoverflow.com/questions/13814958/error-while-retrieving-information-from-the-server-rpcs-7aec-0-in-google-play

And did these steps:

Check if you are using latest version of Google Play.

_ OR _

Following the steps below.

RPC:AEC:0 error is known as CPU/RAM/Device/Identity failure.

Only possible way you can follow to get rid off this error is,

Go to settings >application > Play Store >Clear Data & Clear Cache.

Go to accounts >Google >Remove account.

Reboot device.

Again Settings>Account >Google >Log In.

With no success.

Later I updated all updates possible from Android SDK but got the same error messages again (“Class not found when unmarshalling: com.google.android.finsky.billing.lightpurchase.PurchaseParams”)

I feel a little bit lost with this problem and I have no idea how to proceed. Any help is highly appreciated!

Best regards,

Tomas

Google is throwing an error:

Class not found when unmarshalling: com.google.android.finsky.billing.lightpurchase.PurchaseParams

I googled the error and found this on StackOverflow:

http://stackoverflow.com/questions/13814958/error-while-retrieving-information-from-the-server-rpcs-7aec-0-in-google-play

You can try some of the things in the StackOverlow post, but I guess my first question is this:  Are you testing using your developer account?  Google Play does not let you use your developer account for any e-commerce with your own apps.  You probably can’t even test the test purchases.

Rob

Hi Rob,

I’m using the debug key and uploads the APK directly to my device through a cable.

The Google Play popups and I buy the product with a fake VISA. store.isActive is being printed out but nothing from the transactionListener.

Best regards,

Tomas

Are you logged into Google Play on your device with your registered developer account or a test account?

Are you testing using your developer account?

Note to self: Read everything twice before answering!

Hi Rob,

Yes, I’m using my Developer account. I will try and use another GMail account and see what’s happen!

Thanks!

Best regards,

Tomas