• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Android [SOLVED] Problem importing purchase price from Google Play

Hello. The following error periodically occurs:

if GPBilling_IsStoreConnected()
var _m = GPBilling_Sku_GetPriceAmountMicros(IAP_PurchaseID[2]);
var _c = GPBilling_Sku_GetPriceCurrencyCode(IAP_PurchaseID[2]);
var _val = string(_m / 1000000);

p_price_val[0] = _val;
p_price_sym[0] = _c;

var _m2 = GPBilling_Sku_GetPriceAmountMicros(IAP_PurchaseID[3]);
var _c2 = GPBilling_Sku_GetPriceCurrencyCode(IAP_PurchaseID[3]);
var _val2 = string(_m2 / 1000000);

p_price_val[1] = _val2;
p_price_sym[1] = _c2;

var _m3 = GPBilling_Sku_GetPriceAmountMicros(IAP_PurchaseID[4]);
var _c3 = GPBilling_Sku_GetPriceCurrencyCode(IAP_PurchaseID[4]);
var _val3 = string(_m3 / 1000000);

p_price_val[2] = _val3;
p_price_sym[2] = _c3;

var _m4 = GPBilling_Sku_GetPriceAmountMicros(IAP_PurchaseID[5]);
var _c4 = GPBilling_Sku_GetPriceCurrencyCode(IAP_PurchaseID[5]);
var _val4 = string(_m4 / 1000000);

p_price_val[3] = _val4;
p_price_sym[3] = _c4;

Does anyone know the reason and how to avoid the error?


The DoDiv in the error message tells you something wrong is going into those division operators. Check out the values from those m variables in the debugger and look for abnormalities there.
Solved: We found out that the error occurred in the absence of the Internet. They added the condition that if there is no Internet, do not download data (prices) from Google Play