无法启动服务com.android.vending.billing.IMarketBillingService

时间:2011-03-23 18:21:16

标签: android google-api google-play billing

我正在尝试启动com.android.vending.billing.IMarketBillingService服务,我收到了此消息。我正在使用模拟器Android 2.3.3 - API Level 10。

03-23 15:04:53.535: WARN/ActivityManager(61): Unable to start service Intent { act=com.android.vending.billing.IMarketBillingService }: not found
03-23 15:04:53.535: ERROR/BillingService(416): Could not bind to service.

代码:

private boolean bindToMarketBillingService() {
    try {
        if (Consts.DEBUG) {
            Log.i(TAG, "binding to Market billing service");
        }
        boolean bindResult = bindService(
                new Intent(IMarketBillingService.class.getName()),
                this,  
                Context.BIND_AUTO_CREATE);

        if (bindResult) {
            return true;
        } else {
            Log.e(TAG, "Could not bind to service.");
        }
    } catch (SecurityException e) {
        Log.e(TAG, "Security exception: " + e);
    }
    return false;
}

1 个答案:

答案 0 :(得分:1)

您是否已将IMarketBillingService.aidl添加到您的包中,然后重建您的项目?

如果你试过这个:

boolean bindResult = bindService(new Intent("com.android.vending.billing.MarketBillingService.BIND"), this, Context.BIND_AUTO_CREATE);

为我工作

相关问题