Error when i'm trying to remove a plugin!

I’m trying to remove a few plugins and i get a provider error

Uncaught (in promise): Error: No provider for ScreenOrientation! Error: No provider for ScreenOrientation! at injectionError (http://localhost:8100/build/vendor.js:1738:86) at noProviderError (http://localhost:8100/build/vendor.js:1776:12) 

I remove the plugin doing

cordova plugin remove name-of-plugin

But if i try to do ionic cordova run android i get that error. I remove the plugin of the package.json but nothing works.

Any idea?

you are refering to this plugn somewhere

did you remove the respective ionic-native libs too and, like @FnnHuman said, the references to these?

the ionic-native libs where are located??

For example, if I use the plugin cordova-plugin-x-socialsharing to be able to reference it in my typescript files I use the ionic-native @ionic-native/social-sharing

So to install it I would do:

ionic cordova plugin add cordova-plugin-x-socialsharing --save
npm install @ionic-native/social-sharing --save

Same, to remove it I would have then to remove both, aka:

ionic cordova plugin rm cordova-plugin-x-socialsharing --save
npm remove @ionic-native/social-sharing --save

and then check my code that I don’t reference anymore these libs

1 Like

Thanks, it’s the easiest and effective way

1 Like

I follow your method for ionic app-preferences

For install i use …

$ ionic cordova plugin add cordova-plugin-app-preferences
$ npm install --save @ionic-native/app-preferences

For unintsall

ionic cordova plugin rm cordova-plugin-app-preferences

but show error as

Settings.bundle is generated by external tool, skipping
unhandled exception { Error: ENOENT: no such file or directory, unlink 'platforms/android/res/xml/apppreferences.xml'
  errno: -2,
  code: 'ENOENT',
  syscall: 'unlink',
  path: 'platforms/android/res/xml/apppreferences.xml' }
(node:7043) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, unlink 'platforms/android/res/xml/apppreferences.xml'
(node:7043) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

npm remove --save @ionic-native/app-preferences

this works fine and remove

Still in plugin list I can see

cordova-plugin-app-preferences 0.99.3 “AppPreferences”

please help



To me it look like the remove didn’t work because the plugin wasn’t installed in the Android platform in the first place

But it show in installed list using command

user@acer:~/dreamhouse-mobile-ionic$ ionic cordova plugin
> cordova plugin ls
cordova-plugin-app-preferences 0.99.3 "AppPreferences"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-device 2.0.1 "Device"
cordova-plugin-inappbrowser 2.0.2 "InAppBrowser"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.1 "StatusBar"
cordova-plugin-uniquedeviceid 1.3.2 "UniqueDeviceID"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-sqlite-storage 2.2.0 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"

well I’m just interpreting no such file or directory err msg you get

I read elsewhere that this AppPreferences is not compatible with android 7.0.0+ and that there are other plugins that have issues too. With AppPreferences it is that the build folders do not seem to have the expected structure. So some files were not installed in the first place. When uninstalling the script tries to remove those files and fail.

I started a new project, moved my files and use the sqllite plugin instead.

Hi, First try to delete app-settings.json then try to remove plugins like ,
ionic cordova plugin rm cordova-plugin-app-preferences
its completely remove from plugins list.