DeviceMotion throws 'cordova_not_available'


After installing:
ionic plugin add cordova-plugin-device-motion
import {DeviceMotion} from 'ionic-native';
and running:
var subscription = DeviceMotion.watchAcceleration().subscribe(acceleration => { console.log(acceleration); });

I’m getting 2 errors:
plugin.js:129 TypeError: Cannot read property 'clearWatch' of undefined(…)

By the way I’m also using cordova-plugin-camera and it works flawlessly.

Any ideas how to fix?


Same goes to this plugin:


Doesn’t work with ionic serve or ionic upload. only on a real device or an emulator.


Sounds like a bug to me. When others works fine with ionic run android -l -c -s but these two doesn’t :confused: