Modify cordova plugin - app not see changes - ionic-framework

I need to modify cordova-plugin-media, but when I run app with ionic cordova run android my changes are not applied.
How should I modify and run plugin correctly?

I found the answer.
cordova files should be edited in /plugins folder, not in /node_modules
after editing, I should do: ionic cordova platform rm android and ionic cordova build android
After that modifications work.

You should paste some code, showing the code of app module and config.xml.
But basically you should only do:
ionic cordova plugin add cordova-plugin-media
npm install --save #ionic-native/media
And then add your plugin to the project into file
App.module.ts:
import { Media } from '#ionic-native/media';
...
providers: [
....
Media,
...
]
And that's it, then you should be able to use the functionalities inside your components.

Related

Ionic plugins not installed

I have an issue only with android build, when I running on emulator or device android I get the error that ALL plugins are not installed, on ios emulator or device I dont have this issue
Any idea?
Thanks
Evripides
Maybe your plugins are not prepared.
Try cordova prepare then npm install and finally ionic cordova platform add <your_platform>
Your problem is specific with android so your platform should be android
remove node module and package.json.lock file manually
remove android platform using command ionic cordova platform rm android
npm i
ionic cordova platform add android
and install all plugins like below
ionic cordova plugin add cordova-plugin-file
npm install #ionic-native/file --save
Finaly I found the error on 1 plugin in-app-purchase, I removed it and reinstall it and now all are fine
Thank you all
sometimes android build fails dependencies mismatch so and re run fresh.
delete node_module
npm i
ionic cordova rm android
ionic cordova add platform android

Ionic don't see call-number plugin

I installed call number plugin on ionic. In fact it created a directory to ionic-native but I have the error "console.warn: Ionic Native: tried calling CallNumber.callNumber, but the CallNumber plugin is not installed.".
How I can fix this error?
Please be sure that you installed the cordova plugin:
ionic cordova plugin add call-number
Maybe you can try deleting the platforms and adding them again.
ionic cordova platform remove ios
ionic cordova platform remove android
ionic cordova platform add ios
ionic cordova platform add android

Ionic2 Build folder structure missing

I'm starting to learn Ionic2, I have created a new project with ionic start myproject --v2 and everything works correctly if I do ionic serve.
The build folder is missing in ionic 2 project folder.
Whenever I am trying to download any existing Ionic2 template in that one also build folder missing.
ionic -v 2.0.0-beta.30
cordova -v 6.2.0
node -v v6.2.1
npm -v 3.9.5
your ionic serve build is under www. The native builds ( from ionic build) are under platform.
A little late but I had the same issue and was able to fix it by installing Gulp :
npm install -g gulp
Then I did gulp build.
This solved my issues and generated the build folder as it was supposed to.
First you need to add support for the platform/s you are working with, by executing from Ionic CLI console:
ionic platform add android
or
ionic platform add ios
And then you should build your project by executing:
ionic build android
or
ionic build ios

Can't run Ionic on Android: class not found exception IonicKeyboard

After building and running android app it closes.
Viewing Eclipse logcat it shows a class not found exception com.ionic.keyboard.IonicKeyboard
I'm new with Ionic and I don't know how to make it work. Thanks in advance
I had the same problems.
In my case the plugin was already installed, so I had to remove and add it again:
Try this in your app-folder:
cordova plugin remove com.ionic.keyboard
and
cordova plugin add com.ionic.keyboard
npm changed plugin names. Now it should be
cordova plugin add ionic-plugin-keyboard
Try this in your app-folder:
cordova plugin remove ionic-plugin-keyboard
and
cordova plugin add ionic-plugin-keyboard
Seems that plugin not installed?
Try in cmd:
cordova plugin add com.ionic.keyboard

Ionic cordova plugin not showing up

new to ionic I'm using windows 7 with ionic I tried ..ionic add plugin ... to add new plugins when I check my directory structure the plugins are not installed how do I add new plugins and how do I check if the install worked
I think you want to add a cordova plugin, not an ionic plugin? If so you have to do it like this:
cordova plugin add [plugin]
for e.g. the network plugin:
cordova plugin add org.apache.cordova.network-information
The plugin now should show up in the app/plugins folder
Hope this helps!