cordova-plugin-inapppurchase icon indicating copy to clipboard operation
cordova-plugin-inapppurchase copied to clipboard

After installing cordova-plugin-inapppurchase I am getting error related to Inappbilling

Open vkrntteotia opened this issue 6 years ago • 5 comments

After i install inapppurchase plugin and its dependency then i tried to build the apk file by running: ionic cordova build android --release

Console output

C:\Users\admin\qrScanner\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; ^ C:\Users\admin\qrScanner\platforms\android\app\src\main\java\com\alexdisler\inapppurchases\IabHelper.java:103: error: cannot find symbol

IInAppBillingService mService;
^

symbol: class IInAppBillingService location: class IabHelper C:\Users\admin\qrScanner\platforms\android\app\src\main\java\com\alexdisler\inapppurchases\IabHelper.java:230: error: package IInAppBillingService does not exist

            mService = IInAppBillingService.Stub.asInterface(service);
                                           ^

3 errors

FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:compileReleaseJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 5s 27 actionable tasks: 1 executed, 26 up-to-date (node:16868) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output: C:\Users\admin\qrScanner\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; ^ C:\Users\admin\qrScanner\platforms\android\app\src\main\java\com\alexdisler\inapppurchases\IabHelper.java:103: error: cannot find symbol IInAppBillingService mService; ^ symbol: class IInAppBillingService location: class IabHelper C:\Users\admin\qrScanner\platforms\android\app\src\main\java\com\alexdisler\inapppurchases\IabHelper.java:230: error: package IInAppBillingService does not exist mService = IInAppBillingService.Stub.asInterface(service); ^ 3 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:compileReleaseJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 5s at ChildProcess.whenDone (C:\Users\admin\qrScanner\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:925:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) (node:16868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:16868) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Type of product you are working with consumable/non-consumable/subscription

I am working over consumable products

Version of cordova

version is 8.0.0

Version of iOS/Android

android version 7.0.0

vkrntteotia avatar Jul 29 '18 19:07 vkrntteotia

i'm getting same error

thesayyn avatar Aug 01 '18 12:08 thesayyn

Use the plugin cordova-plugin-inapppurchase-fixed instead.

Just in case you are curious why this is. Read the other Open/Closed Bug Reports and Pull Requests to know the reason. So, if need be, you can make your own fork or support other forked versions of this cordova plugin.

Sample References: https://github.com/AlexDisler/cordova-plugin-inapppurchase/pull/207 , https://github.com/AlexDisler/cordova-plugin-inapppurchase/pull/231 , and https://github.com/AlexDisler/cordova-plugin-inapppurchase/pull/208

Chadori avatar Aug 01 '18 16:08 Chadori

But in a nutshell::

This is a compatibility issue for Cordova CLI Version 7.0.0 and Cordova CLI Version 8.0.0. Which is fixed by using the forked plugin instead. Please, close afterwards when fixed.

Chadori avatar Aug 01 '18 16:08 Chadori

Thank you so much

thesayyn avatar Aug 01 '18 16:08 thesayyn

@ChadoriRebornXD Thank you, it solves the problem.

IvanLencina avatar Aug 08 '18 04:08 IvanLencina