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

发布于 2024-10-26 00:35:12 字数 973 浏览 0 评论 0原文

我正在尝试启动 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;
}

I'm trying start com.android.vending.billing.IMarketBillingService service and I received this message. I'm using emulator 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.

Code:

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;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天暗了我发光 2024-11-02 00:35:12

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

如果你尝试过这个:

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

对我有用

have you added the IMarketBillingService.aidl to your package and then rebuilt your project?

If you have try this:

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

worked for me

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文