j3k0 / cordova-plugin-purchase

In-App Purchase for Cordova on iOS, Android and Windows
https://purchase.cordova.fovea.cc
1.29k stars 529 forks source link

Error 6777001: Init failed - String resource ID #0x0 on Android #767

Closed aesculus closed 5 years ago

aesculus commented 5 years ago

All Android releases Phonegap Build cli-8.0.0 (Android at 7.0.0) Device: Specifically Galaxy S5 with Android 6.01 for my test device. But all my users are experiencing same error Plugin Version: 7.2.1


In the past the store acknowledge all purchases. Recently I am seeing this error on startup.

These are auto renewing subscriptions and have been active for years. I had to disable all subscription services because of this.

Here is the debug log file.

`plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'dag_tesla_to_yearly registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'subscription registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'paid subscription registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'subscription registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'dag_tesla_to_yearly updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'subscription updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'paid subscription updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'subscription updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'dag_tesla_to_monthly registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'subscription_m registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'paid subscription registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'subscription registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'dag_tesla_to_monthly updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'subscription_m updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'paid subscription updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'subscription updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'dag_tesla_to_annual registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'subscription_a registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'paid subscription registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'subscription registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'dag_tesla_to_annual updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'subscription_a updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'paid subscription updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'subscription updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.queries !! 'updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries ++ 'subscription updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries ++ 'subscription_m updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries ++ 'subscription_a updated'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries ++ 'subscription approved'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries ++ 'subscription_m approved'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries ++ 'subscription_a approved'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries ++ 'subscription verified'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries ++ 'subscription_m verified'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries ++ 'subscription_a verified'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries ++ 'subscription unverified'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries ++ 'subscription_m unverified'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries ++ 'subscription_a unverified'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.trigger -> triggering action refreshed
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries !! 'refreshed'
plugins/cc.fovea.cordova.purchase/www/store-android.js:2040 InAppBilling[js]: setup ok
plugins/cc.fovea.cordova.purchase/www/store-android.js:2040 InAppBilling[js]: load ["dag_tesla_to_yearly","dag_tesla_to_monthly","dag_tesla_to_annual"]
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.trigger -> triggering action refreshed
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries !! 'refreshed'
plugins/cc.fovea.cordova.purchase/www/store-android.js:2040 InAppBilling[js]: setup ok
plugins/cc.fovea.cordova.purchase/www/store-android.js:2040 InAppBilling[js]: load ["dag_tesla_to_yearly","dag_tesla_to_monthly","dag_tesla_to_annual","dag_tesla_to_yearly","dag_tesla_to_monthly","dag_tesla_to_annual"]
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: refresh -> checking products state (3 products)
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: refresh -> product id dag_tesla_to_yearly (subscription)
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG:            in state 'registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: refresh -> product id dag_tesla_to_monthly (subscription_m)
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG:            in state 'registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: refresh -> product id dag_tesla_to_annual (subscription_a)
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG:            in state 'registered'
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: store.trigger -> triggering action re-refreshed
plugins/cc.fovea.cordova.purchase/www/store-android.js:1513 [store.js] DEBUG: queries !! 're-refreshed'
plugins/cc.fovea.cordova.purchase/www/store-android.js:2040 InAppBilling[js]: getPurchases called!
app_iap.js:68 Store Error Error 6777001: Init failed - String resource ID #0x0`
j3k0 commented 5 years ago

Did this happen after an update of the App? The errors generally indicates that the billing_key.xml file cannot be found among android resources.

cordova-android@7 created issues with assets installation (by introducing a new project structure).

This should be solved by upgrading to platform cordova-android@7.1.4 and plugin cc.fovea.cordova.purchase@7.3.0-beta.0 (7.2.5 contains a hook that might not be compatible with PhoneGap, I didn't check).

aesculus commented 5 years ago

Thanks for the comments. It did come about after an update. I went back into my apks and installed one two releases ago and that one is fine. The last two have the issue. The other weird thing is that the splash screen on these last two versions is skewed too. Maybe that's a hint?

I am going to take the source for the working version and try recompiling it (after changing the build number) and see what it does.

aesculus commented 5 years ago

A bit of an update. The skewed splash was my fault for commenting out <preference name="SplashMaintainAspectRatio" value="true" />

On the plugin front: I thought I had gone back to the version that worked (7.2.0) but it turns out I had it set as 7.2.1. So 7.2.0 works for me but greater than that does not.

I am stuck with PGB whose latest is Android 7.1.2. I am going to revert back to your plugin at 7.2.0 and when PGB supports Android 7.1.4 I will update your plugin accordingly.

Thanks for helping out with this and coming back so quickly.

j3k0 commented 5 years ago

You're welcome. I'm glad you found a solution.

On Wed, Nov 28, 2018 at 10:04:19AM -0800, Chris C wrote:

Closed #767.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/j3k0/cordova-plugin-purchase/issues/767#event-1993185692

jaafit commented 5 years ago

Hi, I'm getting the same error. Galaxy S5 phongap CLI version 8.2.2 cordova-plugin-purchase v 7.2.4.

package.json.txt

I built my apk with "phonegap remote build android" and the billing key is in my config.xml.txt

I tried to use cordova-plugin-purchase v7.2.0 but it is not available on npm and thus not available to PGB.

I'm not sure how to access the log as aesculus did above.

Any help is appreciated.

aesculus commented 5 years ago

Should be on NPM. It was last week

<plugin name="cc.fovea.cordova.purchase" source="npm" spec="7.2.0" >

jaafit commented 5 years ago

Thanks, now I've successfully loaded the price of my product using 7.2.0

The problem was, I was using "cordova-plugin-purchase" before, and this does not have version 7.2.0. I'm curious to why there are two. What's the use case for "cordova-plugin-purchase"?

Dexus commented 5 years ago

Hello @jaafit we have adopted this package at NPM because it was no longer maintained, so there was a version jump from 1.0.4 to 7.2.4. Currently we maintain two or three? Packages that basically contain the same plugin, but have not yet been merged into one package due to dependencies in projects of the developers.

Regards, Josef

aesculus commented 5 years ago

@Dexus Just note above that for Phonegap Build users they must stay on 7.2.0 because they cannot migrate to 7.2.4 until PGB supports the underlying Android framework.

Dexus commented 5 years ago

Ah damn, I missed the phonegap.

sharpMouse commented 4 years ago

What's the state of the bug now?

I am using PhoneGap Build and tried, as suggested, to downgrade version to ~7.2.0. However PhoneGap Build has no this version, the version it suggests is 7.2.8 which doesn't work. I tryed to downgrade version to ~7.1.0, but PhoneGap Build suggests none and fails the build.

What should I do?

aesculus commented 4 years ago

I am using this until PGB is updated: `

`
j3k0 commented 4 years ago

Please check documentation: https://github.com/j3k0/cordova-plugin-purchase#install-the-plugin-phonegap

sharpMouse commented 4 years ago

I combined both previous answers and it works!

Thank you for fast help.

aesculus commented 4 years ago

@j3k0 I noticed in the readme that you state. `

`

Where I am using NPM <plugin name="cc.fovea.cordova.purchase" source="npm" spec="7.2.0" >

What version of the plugin would I get if I go to #phonegap-cli-8.0.0 vs my npm setting?

j3k0 commented 4 years ago

The phonagap-cli-8.0.0 branch hasn't been published to npm. Something prevents you from using the git link?

aesculus commented 4 years ago

No. Just had this mental block that npm was more finalized. :-)