j3k0 / cordova-plugin-purchase

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

We've detected that this app uses an unsupported version of Play Billing. Please upgrade to Billing Library version 4 or newer to publish this app. #1358

Closed vpteamdev closed 1 year ago

vpteamdev commented 1 year ago

Observed behavior

Loading the apk/aab on Google Play Store during the step of revision the following error is returned:

We've detected that this app uses an unsupported version of Play Billing. Please upgrade to Billing Library version 4 or newer to publish this app.

Expected behavior

Since every related dependency os updated to the last version the error should be not returned.

System Info

OS: MacOs Monterey 12.6 Node version: 16.16.0 NPM version: 8.11.0 Ionic version 6.19.1 Cordova version: 11.0.0

Output of cordova info.

Cordova Packages:

    cli: 11.0.0
        common: 4.0.2
        create: 4.0.0
        lib: 11.0.0
            common: 4.0.2
            fetch: 3.0.1
            serve: 4.0.0

Project Installed Platforms:

    android: 11.0.0

Project Installed Plugins:

    @havesource/cordova-plugin-push: 2.0.1-dev.0
    cc.fovea.cordova.purchase: 10.5.3
    cordova-plugin-androidx-adapter: 1.1.3
    cordova-plugin-app-version: 0.1.14
    cordova-plugin-camera: 6.0.0
    cordova-plugin-device: 2.1.0
    cordova-plugin-facebook-connect: 3.2.0
    cordova-plugin-file: 7.0.0
    cordova-plugin-firebase-analytics: 6.1.0
    cordova-plugin-firebase-dynamiclinks: 6.1.3
    cordova-plugin-inappbrowser: 5.0.0
    cordova-plugin-ionic-keyboard: 2.2.0
    cordova-plugin-ionic-webview: 5.0.0
    cordova-plugin-media-capture: 4.0.0
    cordova-plugin-network-information: 3.0.0
    cordova-plugin-splashscreen: 6.0.2
    cordova-plugin-statusbar: 3.0.0
    cordova-plugin-x-socialsharing: 6.0.4
    cordova-support-android-plugin: 1.0.2
    es6-promise-plugin: 4.2.2
    ionic-plugin-deeplinks: 1.0.22

Environment:

    OS: macOS Monterey 12.6 (21G115) (darwin 21.6.0) x64
    Node: v16.16.0
    npm: 8.11.0

android Environment:

    android:
ERROR: Command failed with exit code 1: avdmanager list target
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
        at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
        at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
        at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
        at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:213)
        at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 5 more

Project Setting Files:

    config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget id="XXX" version="1.8.46" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>XXX</name>
    <description>XXX</description>
    <author email="XXX" href="XXX">XXX</author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <allow-navigation href="*" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="3000" />
    <preference name="AllowInlineMediaPlayback" value="true" />
    <preference name="Orientation" value="portrait" />
    <platform name="android">
        <preference name="android-minSdkVersion" value="22" />
        <preference name="android-targetSdkVersion" value="31" />
        <preference name="AndroidXEnabled" value="true" />
        <preference name="AndroidLaunchMode" value="singleTask" />
        <preference name="AndroidPersistentFileLocation" value="Compatibility" />
        <preference name="GradlePluginGoogleServicesEnabled" value="true" />
        <preference name="GradlePluginGoogleServicesVersion" value="4.3.14" />
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
            <application android:networkSecurityConfig="@xml/network_security_config" />
            <application android:requestLegacyExternalStorage="true" />
            <comment>Probably can be remove since this is published: https://github.com/apache/cordova-plugin-camera/pull/684/commits/fae094ae5d6366760231b5af7b3a0d6eecb3bd03</comment>
            <queries>
                <intent>
                    <action android:name="android.media.action.IMAGE_CAPTURE" />
                </intent>
                <intent>
                    <action android:name="android.intent.action.GET_CONTENT" />
                </intent>
            </queries>
        </edit-config>
        <resource-file src="google-services.json" target="app/google-services.json" />
        <resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
        <resource-file src="resources/android/icon/push_icon.png" target="app/src/main/res/drawable/push_icon.png" />
        <allow-intent href="market:*" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
        <icon background="resources/android/icon/ldpi-background.png" density="ldpi" foreground="resources/android/icon/ldpi-foreground.png" />
        <icon background="resources/android/icon/mdpi-background.png" density="mdpi" foreground="resources/android/icon/mdpi-foreground.png" />
        <icon background="resources/android/icon/hdpi-background.png" density="hdpi" foreground="resources/android/icon/hdpi-foreground.png" />
        <icon background="resources/android/icon/xhdpi-background.png" density="xhdpi" foreground="resources/android/icon/xhdpi-foreground.png" />
        <icon background="resources/android/icon/xxhdpi-background.png" density="xxhdpi" foreground="resources/android/icon/xxhdpi-foreground.png" />
        <icon background="resources/android/icon/xxxhdpi-background.png" density="xxxhdpi" foreground="resources/android/icon/xxxhdpi-foreground.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <resource-file src="GoogleService-Info.plist" target="../GoogleService-Info.plist" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
        <icon height="20" src="resources/ios/icon/icon-20.png" width="20" />
        <icon height="40" src="resources/ios/icon/icon-20@2x.png" width="40" />
        <icon height="60" src="resources/ios/icon/icon-20@3x.png" width="60" />
        <icon height="48" src="resources/ios/icon/icon-24@2x.png" width="48" />
        <icon height="55" src="resources/ios/icon/icon-27.5@2x.png" width="55" />
        <icon height="29" src="resources/ios/icon/icon-29.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-29@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-29@3x.png" width="87" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
        <icon height="88" src="resources/ios/icon/icon-44@2x.png" width="88" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
        <icon height="172" src="resources/ios/icon/icon-86@2x.png" width="172" />
        <icon height="196" src="resources/ios/icon/icon-98@2x.png" width="196" />
        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="1125" src="resources/ios/splash/Default-Landscape-2436h.png" width="2436" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="2436" src="resources/ios/splash/Default-2436h.png" width="1125" />
        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
        <edit-config file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
            <string>L'applicazione necessita dell'accesso alla fotocamera per scattare la foto del tuo profilo e per registrare i video di presentazione al talent e/o di partecipazione alle sfide pubblicate</string>
        </edit-config>
        <edit-config file="*-Info.plist" mode="merge" target="NSMicrophoneUsageDescription">
            <string>L'applicazione necessita dell'accesso al microfono per registrare i suoni dei video di presentazione al talent e delle sfide proposte</string>
        </edit-config>
        <edit-config file="*-Info.plist" mode="merge" target="NSPhotoLibraryUsageDescription">
            <string>L'applicazione necessita dell'accesso alla libreria per caricare immagini relative alla foto del tuo profilo e video di presentazione al talent e/o di partecipazione alle sfide pubblicate</string>
        </edit-config>
        <edit-config file="*-Info.plist" mode="merge" target="UIUserInterfaceStyle">
            <string>Light</string>
        </edit-config>
        <edit-config file="*-Info.plist" mode="merge" target="UIViewControllerBasedStatusBarAppearance">
            <true />
        </edit-config>
        <edit-config file="*-Info.plist" mode="overwrite" target="CFBundleDevelopmentRegion">
            <array>
                <string>Italian</string>
            </array>
        </edit-config>
        <edit-config file="*-Info.plist" mode="overwrite" target="CFBundleLocalizations">
            <array>
                <string>it</string>
            </array>
        </edit-config>
        <config-file parent="com.apple.developer.associated-domains" target="*-Debug.plist">
            <array>
                <string>XXX</string>
                <string>XXX</string>
                <string>XXX</string>
                <string>XXX</string>
            </array>
        </config-file>
        <config-file parent="com.apple.developer.associated-domains" target="*-Release.plist">
            <array>
                <string>XXX</string>
                <string>XXX</string>
                <string>XXX</string>
                <string>XXX</string>
            </array>
        </config-file>
        <icon height="216" src="resources/ios/icon/icon-108@2x.png" width="216" />
        <splash height="2688" src="resources/ios/splash/Default-2688h~iphone.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-2688h~iphone.png" width="2688" />
        <splash height="1792" src="resources/ios/splash/Default-1792h~iphone.png" width="828" />
        <splash height="828" src="resources/ios/splash/Default-Landscape-1792h~iphone.png" width="1792" />
    </platform>
    <plugin name="cordova-plugin-statusbar" spec="~2.4.2" />
    <plugin name="cordova-plugin-device" spec="~2.0.2" />
    <plugin name="cordova-plugin-splashscreen" spec="~5.0.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^4.0.0">
        <variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
    </plugin>
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
    <plugin name="cordova-plugin-x-socialsharing" spec="~5.6.8">
        <variable name="ANDROID_SUPPORT_V4_VERSION" value="24.1.1+" />
    </plugin>
    <plugin name="cordova-plugin-file" spec="~6.0.2" />
    <plugin name="cordova-plugin-media-capture" spec="^3.0.3" />
    <plugin name="ionic-plugin-deeplinks" spec="^1.0.20">
        <variable name="URL_SCHEME" value="oou" />
        <variable name="DEEPLINK_SCHEME" value="https" />
        <variable name="DEEPLINK_HOST" value="XXX" />
        <variable name="DEEPLINK_2_HOST" value="XXX" />
    </plugin>
    <plugin name="cordova-plugin-camera" spec="^5.0.1" />
    <engine name="ios" spec="6.1.1" />
    <engine name="android" spec="9.0.0" />
</widget>

    package.json:
--- Start of Cordova JSON Snippet ---
{
  "plugins": {
    "cordova-plugin-statusbar": {},
    "cordova-plugin-device": {},
    "cordova-plugin-splashscreen": {},
    "cordova-plugin-ionic-webview": {
      "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
    },
    "cordova-plugin-ionic-keyboard": {},
    "cordova-plugin-file": {
      "ANDROIDX_WEBKIT_VERSION": "1.4.0"
    },
    "cordova-plugin-x-socialsharing": {
      "ANDROID_SUPPORT_V4_VERSION": "24.1.1+",
      "PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
      "PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly."
    },
    "cordova-plugin-media-capture": {},
    "cordova-plugin-inappbrowser": {},
    "cordova-plugin-network-information": {},
    "@havesource/cordova-plugin-push": {
      "ANDROIDX_CORE_VERSION": "1.6.+",
      "FCM_VERSION": "18.+",
      "IOS_FIREBASE_MESSAGING_VERSION": "~> 8.8.0",
      "ANDROID_SUPPORT_V13_VERSION": "28.0.0"
    },
    "cordova-plugin-app-version": {},
    "ionic-plugin-deeplinks": {
      "URL_SCHEME": "oou",
      "DEEPLINK_SCHEME": "https",
      "DEEPLINK_HOST": "XXX",
      "ANDROID_PATH_PREFIX": "/",
      "ANDROID_2_PATH_PREFIX": "/",
      "ANDROID_3_PATH_PREFIX": "/",
      "ANDROID_4_PATH_PREFIX": "/",
      "ANDROID_5_PATH_PREFIX": "/",
      "DEEPLINK_2_SCHEME": "https",
      "DEEPLINK_2_HOST": "XXX",
      "DEEPLINK_3_SCHEME": " ",
      "DEEPLINK_3_HOST": " ",
      "DEEPLINK_4_SCHEME": " ",
      "DEEPLINK_4_HOST": " ",
      "DEEPLINK_5_SCHEME": " ",
      "DEEPLINK_5_HOST": " "
    },
    "cordova-plugin-camera": {
      "ANDROID_SUPPORT_V4_VERSION": "27.+",
      "ANDROIDX_CORE_VERSION": "1.6.+"
    },
    "cordova-plugin-facebook-connect": {
      "APP_ID": "XXX",
      "APP_NAME": "One Of Us",
      "FACEBOOK_HYBRID_APP_EVENTS": "false",
      "FACEBOOK_URL_SCHEME_SUFFIX": " ",
      "FACEBOOK_AUTO_LOG_APP_EVENTS": "true",
      "FACEBOOK_ADVERTISER_ID_COLLECTION": "true",
      "OTHER_APP_SCHEMES": " ",
      "FACEBOOK_ANDROID_SDK_VERSION": "11.3.0",
      "FACEBOOK_IOS_SDK_VERSION": "11.1.0",
      "FACEBOOK_BROWSER_SDK_VERSION": "v11.0"
    },
    "cc.fovea.cordova.purchase": {
      "BILLING_KEY": "XXX"
    },
    "cordova-plugin-androidx-adapter": {},
    "cordova-plugin-firebase-analytics": {
      "IOS_FIREBASE_POD_VERSION": "~> 8.8.0",
      "ANALYTICS_COLLECTION_ENABLED": "false",
      "ANDROID_FIREBASE_ANALYTICS_VERSION": "18.+",
      "IOS_FIREBASE_ANALYTICS_VERSION": "18.+",
      "AUTOMATIC_SCREEN_REPORTING_ENABLED": "false"
    },
    "cordova-plugin-firebase-dynamiclinks": {
      "APP_DOMAIN_NAME": "XXX",
      "ANDROID_FIREBASE_DYNAMICLINKS_VERSION": "20.1.+",
      "APP_DOMAIN_PATH": "/links",
      "IOS_FIREBASE_POD_VERSION": "~> 8.8.0"
    }
  },
  "platforms": [
    "ios",
    "android"
  ]
}
--- End of Cordova JSON Snippet ---

Additional Information:

plugins/cc.fovea.cordova.purchase/plugin.xml:

<!-- To ensure we're using the latest version, see here:
        https://developer.android.com/google/play/billing/billing_library_releases_notes -->
      <framework src="com.android.billingclient:billing:3.0.0" />
      <source-file src="src/android/cc/fovea/PurchasePlugin.java" target-dir="src/cc/fovea" />
      <source-file src="src/android/cc/fovea/Constants.java" target-dir="src/cc/fovea" />

I think this version should be al least 4.0.0

Consequently i have in build.gradle: implementation "com.android.billingclient:billing:3.0.0"

Thanks :)

Luro91 commented 1 year ago

You need to update the plugin to v11: Billing library 4 is supported since v 11.0.0: https://github.com/j3k0/cordova-plugin-purchase/blob/master/RELEASE_NOTES.md#upgrade-to-google-play-billing-library-v40

j3k0 commented 1 year ago

Yes, uninstall cc.fovea.cordova.purchase and install cordova-plugin-purchase will give you the latest version.