j3k0 / cordova-plugin-purchase

In-App Purchase for Cordova on iOS, Android and Windows
https://purchase.cordova.fovea.cc
1.29k stars 529 forks source link

Problem running on Android with Capacitor 6.0.0 (startServiceConnection in class PurchasePlugin, deprecated API) #1559

Closed MarcelSchuermann closed 2 weeks ago

MarcelSchuermann commented 2 weeks ago

Observed behavior

Problem when trying to deploy and run android with version 6.0.0 of Capacitor and cordova-plugin-purchase 13.10.0.

Following error occurs, when trying to run Android Capacitor:

        > Task :capacitor-cordova-android-plugins:compileDebugJavaWithJavac
        C:\...\android\capacitor-cordova-android-plugins\src\main\java\cc\fovea\PurchasePlugin.java:307: error: method startServiceConnection in class PurchasePlugin cannot be applied to given types;
        startServiceConnection(() -> {
        ^
        required: Runnable,Runnable
        found:    ()->{ if ([...]; } }
        reason: actual and formal argument lists differ in length
        Note: C:\...\android\capacitor-cordova-android-plugins\src\main\java\cc\fovea\PurchasePlugin.java uses or overrides a deprecated API.
        Note: Recompile with -Xlint:deprecation for details.
        1 error

        > Task :capacitor-cordova-android-plugins:compileDebugJavaWithJavac FAILED
        > Task :app:processDebugResources

        FAILURE: Build failed with an exception.

Expected behavior

The Android deployment with Capacitor 6.0.0 works as with older Version Capacitor 5.x.

System Info

Capacitor 6.0.0 Cordova-purchase-plugin 13.10.0

MarcelSchuermann commented 2 weeks ago

With cordova-plugin-purchase 13.10.1 it seems to work (or I had to install it again via npm).