将cordova-plugin-inapppurchase添加到我的项目中之后,为android平台构建网络资产失败:
<project_folder>\platforms\android\app\src\main\java\com\alexdisler\inapppurchases\IabHelper.java:33: error: package com.android.vending.billing does not exist
import com.android.vending.billing.IInAppBillingService;
^
<project_folder>\platforms\android\app\src\main\java\com\alexdisler\inapppurchases\IabHelper.java:103: error: cannot find symbol
IInAppBillingService mService;
^
symbol: class IInAppBillingService
location: class IabHelper
<project_folder>\platforms\android\app\src\main\java\com\alexdisler\inapppurchases\IabHelper.java:230: error: package IInAppBillingService does not exist
mService = IInAppBillingService.Stub.asInterface(service);
^
Note: Some input files use or override a deprecated API.
FAILED
Note: Recompile with -Xlint:deprecation for details.
3 errors
FAILURE: Build failed with an exception.
答案 0 :(得分:8)
在项目的根文件夹中执行此操作(它将aidl
文件复制到正确的文件夹中)
ionic cordova platform add android
mkdir platforms\android\app\src\main\aidl\com\android\vending\billing\
copy platforms\android\src\com\android\vending\billing\IInAppBillingService.aidl platforms\android\app\src\main\aidl\com\android\vending\billing\
答案 1 :(得分:4)
对于Mac
mkdir -p platforms/android/app/src/main/aidl/com/android/vending/billing
cp platforms/android/src/com/android/vending/billing/IInAppBillingService.aidl platforms/android/app/src/main/aidl/com/android/vending/billing
答案 2 :(得分:0)
这对我有用。 谢谢:)
ionic cordova平台添加android
mkdir平台\ android \ app \ src \ main \ aidl \ com \ android \ vending \ billing \
复制platform \ android \ src \ com \ android \ vending \ billing \ IInAppBillingService.aidl platform \ android \ app \ src \ main \ aidl \ com \ android \ vending \ billing \