我将我的phonegap应用程序从phonegap构建移动到非构建,我正在努力设置插件。代码都与build一起使用,所以我希望尽可能多地保留它。
我试图运行Android App Billing插件。我把它克隆到目录然后添加:
Toms-Mac-mini:Tagi tombeech$ phonegap local plugin add AndroidInAppBilling/v3/
[phonegap] adding the plugin: AndroidInAppBilling/v3/
[phonegap] successfully added the plugin
然后我添加了JS文件,引用它并加载它:
<script type="text/javascript" charset="utf-8" src="js/inappbilling.js"></script>
但是,我的代码在准备就绪时没有初始化。我看过android logcat,我得到了:
07-15 16:43:11.724: E/PluginManager(1367): Uncaught exception from plugin
07-15 16:43:11.724: E/PluginManager(1367): android.content.res.Resources$NotFoundException: String resource ID #0x0
07-15 16:43:11.724: E/PluginManager(1367): at android.content.res.Resources.getText(Resources.java:1096)
07-15 16:43:11.724: E/PluginManager(1367): at android.content.res.Resources.getString(Resources.java:1190)
07-15 16:43:11.724: E/PluginManager(1367): at android.content.Context.getString(Context.java:351)
07-15 16:43:11.724: E/PluginManager(1367): at com.smartmobilesoftware.inappbilling.InAppBillingPlugin.init(InAppBillingPlugin.java:122)
07-15 16:43:11.724: E/PluginManager(1367): at com.smartmobilesoftware.inappbilling.InAppBillingPlugin.execute(InAppBillingPlugin.java:67)
07-15 16:43:11.724: E/PluginManager(1367): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65)
07-15 16:43:11.724: E/PluginManager(1367): at org.apache.cordova.PluginManager.execHelper(PluginManager.java:242)
07-15 16:43:11.724: E/PluginManager(1367): at org.apache.cordova.PluginManager.exec(PluginManager.java:227)
07-15 16:43:11.724: E/PluginManager(1367): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
07-15 16:43:11.724: E/PluginManager(1367): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
07-15 16:43:11.724: E/PluginManager(1367): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
07-15 16:43:11.724: E/PluginManager(1367): at android.os.Handler.dispatchMessage(Handler.java:102)
07-15 16:43:11.724: E/PluginManager(1367): at android.os.Looper.loop(Looper.java:157)
07-15 16:43:11.724: E/PluginManager(1367): at android.os.HandlerThread.run(HandlerThread.java:61)
这些错误看起来不太好,我对下一步该怎么做感到困惑。这些插件似乎都没有正常工作。
答案 0 :(得分:0)
您应该在res / values中为您的应用设置billing_key。 https://github.com/poiuytrez/AndroidInAppBilling/blob/master/v3/README.md
中的更多信息