[英]cordova-plugin-inapppurchase error: package com.android.vending.billing does not exist
After adding the cordova-plugin-inapppurchase to my project, building web assets for android platform fails: 将cordova-plugin-inapppurchase添加到我的项目后,为android平台构建Web资产失败:
<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.
Execute this in the root folder of your project (it copies the aidl
file to the proper folder) 在项目的根文件夹中执行此操作(它将
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\
For Mac 对于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
This works for me. 这适合我。 Thanks :)
谢谢 :)
ionic cordova platform add android 离子cordova平台添加android
mkdir platforms\\android\\app\\src\\main\\aidl\\com\\android\\vending\\billing\\ mkdir平台\\ 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\\ 复制平台\\ android \\ src \\ com \\ android \\ vending \\ billing \\ IInAppBillingService.aidl platforms \\ android \\ app \\ src \\ main \\ aidl \\ com \\ android \\ vending \\ billing \\
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.