this is the error i have: “device not supported”. The device that i am testing has android 5.0. I dont know what can be wrong.Please help
- What plugin are you using? Link?
- Are you using it via Ionic Native? Link?
- Where exactly do you get that error?
- What is the exact, complete error?
- What is your
ionic info
output?
1_ https://github.com/apache/cordova-plugin-screen-orientation
2_ Yes. https://ionicframework.com/docs/native/screen-orientation/
3_ I put this code in the constructor of app.component.ts:
if (this.platform.is('cordova')) {
this.platform.ready().then(() => {
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);
})
}
4_ Uncaught(in promise): NotSupportedError. screen.orientation.lock() is not available on this device.
5_global packages:
@ionic/cli-utils : 1.3.0
Cordova CLI : 7.0.1
Ionic CLI : 3.3.0
local packages:
@ionic/app-scripts : 1.3.7
@ionic/cli-plugin-cordova : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.2.1
System:
Node : v6.10.3
OS : Windows 7
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
Looks good.
What device are you testing on?
Does it work on other devices?
I solve it after updating the plugin to 2.0.0 version.
Thanks for your help.
1 Like