Hi all,
I am building my cordova app with Ionic appflow.
One of the plugins I am using requires the build environment to use Cordova Android 9.0.0 ( https://cordova.apache.org/announcements/2020/06/29/cordova-android-9.0.0.html ).
The plugin which requires this is version 2.0.0 of the cordova-plugin-health ( https://github.com/dariosalvi78/cordova-plugin-health ).
If I put version 1.1.4 in my config.xml for cordova-plugin-health it builds fine in Ionic appflow.
If I put version 2.0.0 I get the following error output (see below).
…
ask :app:compileReleaseJavaWithJavac FAILED
/builds/MichielJ87/FitnessPetsRelease/platforms/android/app/src/main/java/org/apache/cordova/health/HealthPlugin.java:149: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
^
symbol: variable Q
location: class VERSION_CODES
/builds/MichielJ87/FitnessPetsRelease/platforms/android/app/src/main/java/org/apache/cordova/health/HealthPlugin.java:154: error: cannot find symbol
if (!cordova.hasPermission(Manifest.permission.ACTIVITY_RECOGNITION))
^
symbol: variable ACTIVITY_RECOGNITION
location: class permission
/builds/MichielJ87/FitnessPetsRelease/platforms/android/app/src/main/java/org/apache/cordova/health/HealthPlugin.java:155: error: cannot find symbol
dynPerms.add(Manifest.permission.ACTIVITY_RECOGNITION);
^
symbol: variable ACTIVITY_RECOGNITION
location: class permission
According to the plugin creator of cordova-plugin-health, this is due to the fact that the build environment is not using Cordova Android 9.0.0. You can see his response over here https://gitter.im/cordova-plugin-health/Lobby (see response Dario Salvi).
This plugin is essential for my app, and I need to use version 2.0.0 before April 2021, since Google will stop supporting the previous version of Google Fit from then on.
If anybody could please help me on this topic? Many thanks in advance!
Kind regards,
Michiel