簡體   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