繁体   English   中英

Android Studio错误:包com.android.vending.billing.util不存在

[英]Android Studio error: package com.android.vending.billing.util does not exist

目前正在实施应用内结算并完成以下操作。

更新了清单以包含结算

放置aidl文件aidl文件夹// com.android.vending.billing。 “IInAppBillingService.aidl”

然后我在同一目录com.android.vending.billing.util.IabHelper中的“util”下也有帮助器类;

在我的主要活动中将它们作为导入运行时,我在编译时遇到错误,但在导入这些变量时会识别缺失的变量。

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.content.Intent;

import com.android.vending.billing.IInAppBillingService;
import com.android.vending.billing.util.IabHelper;
import com.android.vending.billing.util.IabResult;
import com.android.vending.billing.util.Purchase;
import com.android.vending.billing.util.Inventory;

错误如下。

错误:(11,40)错误:包com.android.vending.billing.util不存在

错误:(12,40)错误:包com.android.vending.billing.util不存在

错误:(13,40)错误:包com.android.vending.billing.util不存在

错误:(14,40)错误:包com.android.vending.billing.util不存在

不知道这里的问题是什么。 所有帮助赞赏

谢谢

由于您将这些文件放在自己的包中,因此必须从那里导入它们。 而不是

import com.android.vending.billing.util.IabHelper;

它应该是

import yourpackage.util.IabHelper;

等等。 我希望我能帮到你!

我想我错过了你的问题:

将IInAppBillingService.aidl保留在它所在的包中,但将所有其他文件(整个util目录)放在主包中,然后从那里导入它们。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM