Open templatetuners opened 2 years ago
this plugin use a deprecated api to retrieve the versionCode. From Api level 28 versionCode was replaced by getLongVersionCode method. To avoid this issue in the AppVersion.java yuo need to:
import android.os.Build;
if (action.equals("getVersionCode")) { PackageManager packageManager = this.cordova.getActivity().getPackageManager(); if(android.os.Build.VERSION.SDK_INT>=28) { callbackContext.success(packageManager.getPackageInfo(this.cordova.getActivity().getPackageName(), 0).getLongVersionCode()); } else { callbackContext.success(packageManager.getPackageInfo(this.cordova.getActivity().getPackageName(), 0).versionCode); } return true; }
Hope this may help.
cordova\AppVersion.java uses or overrides a deprecated API
cordova 11.0.0