I have been using Ionic Framework for a while but I have recently come across this error plugin_not_installed
for the Health Kit plugin which I know I have based on my ionic cordova plugin list
output.
$ ionic cordova plugin list
> cordova plugin ls
com.telerik.plugins.healthkit 0.5.5 "HealthKit"
cordova-plugin-apprate 1.3.0 "AppRate"
cordova-plugin-badge 0.8.5 "Badge"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-dialogs 1.3.4 "Notification"
cordova-plugin-globalization 1.0.8 "Globalization"
cordova-plugin-google-analytics 1.8.3 "Google Universal Analytics Plugin"
cordova-plugin-inappbrowser 1.7.2 "InAppBrowser"
cordova-plugin-ionic-webview 1.1.16 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.1 "LocalNotification"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.3.0 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"
My code is wrapped in platform.ready()
so I know that everything is loaded. I also have my health kit code that is throwing the error in a healthKit.available()
and a healthKit.requestAuthorization
which have no error.
getWeight.then(function () {
alert("Healthkit is ready!");
alert(weight);
healthKitReady = true;
}).catch(function(err) {
if (err) {
console.log(err); // This is where the error is returned.
}
});
The function getWeight is this:
const getWeight = new Promise(function(resolve, reject) {
var error;
healthKit.readWeight({
unit: "lb"
}).then(function (out) {
weight = Math.round(out.value);
alert("weight: " + weight);
resolve(weight);
}, function (err) {
error = err;
reject(error);
});
});
Just in case this is a version issue this is the output for ionic info:
cli packages: (/usr/local/share/.config/yarn/global/node_modules)
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.4
Cordova Platforms : ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
ios-sim : 6.1.2
Node : v8.9.1
npm : 2.15.12
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro