poiuytrez / AndroidInAppBilling

Android App Billing plugin for Cordova
173 stars 144 forks source link

[solved] inappbilling.init() fails with 'String resource ID #0x0' #70

Open enzym opened 9 years ago

enzym commented 9 years ago

Hi,

I just updated from cordova 3.4 to 3.5 (3.5.0-0.2.7) and reset my app (created with "cordova create ..." and added all the plugins I used + html/js). Now inappbilling - which work without any problem before - fails to init with message 'String resource ID #0x0'. Just before failing the log says 'No package identifier when getting value for resource number 0x00000000'.

Here's the full log from AndroidStudio: D/CordovaLog﹕ file:///android_asset/www/plugins/com.smartmobilesoftware.inappbilling/www/inappbilling.js: Line 6 : InAppBilling[js]: setup ok 09-23 16:57:09.721 5177-5177/? I/Web Console﹕ InAppBilling[js]: setup ok at file:///android_asset/www/plugins/com.smartmobilesoftware.inappbilling/www/inappbilling.js:6 09-23 16:57:09.721 5177-5189/? D/CORDOVA_BILLING﹕ Num SKUs Found: 14 09-23 16:57:09.721 5177-5189/? D/CORDOVA_BILLING﹕ Product SKU ... ... 09-23 16:57:09.721 5177-5189/? D/CORDOVA_BILLING﹕ Product SKU ... 09-23 16:57:09.721 5177-5189/? D/CORDOVA_BILLING﹕ init start 09-23 16:57:09.721 5177-5189/? W/ResourceType﹕ No package identifier when getting value for resource number 0x00000000 09-23 16:57:09.721 5177-5189/? E/PluginManager﹕ Uncaught exception from plugin android.content.res.Resources$NotFoundException: String resource ID #0x0 at android.content.res.Resources.getText(Resources.java:239) at android.content.res.Resources.getString(Resources.java:325) at android.content.Context.getString(Context.java:334) at com.smartmobilesoftware.inappbilling.InAppBillingPlugin.init(InAppBillingPlugin.java:122) at com.smartmobilesoftware.inappbilling.InAppBillingPlugin.execute(InAppBillingPlugin.java:67) at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65) at org.apache.cordova.PluginManager.execHelper(PluginManager.java:242) at org.apache.cordova.PluginManager.exec(PluginManager.java:227) at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53) at android.webkit.JWebCoreJavaBridge.nativeServiceFuncPtrQueue(Native Method) at android.webkit.JWebCoreJavaBridge.nativeServiceFuncPtrQueue(Native Method) at android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:113) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:814) at java.lang.Thread.run(Thread.java:841) Thx

enzym commented 9 years ago

Ok, sorry for this confusion. For some reason the existing file 'billing_key.xml' was not copied to my local build folder.

So the error 'String resource ID #0x0' at inappbilling.init() will raise, if you forgot to create your 'billing_key.xml'.