Issue with @ionic-native Plugins After Upgrading from Ionic 5 to Ionic 7

Hi everyone,

I recently upgraded my project from Ionic 5 to Ionic 7, and I noticed that some plugins I used before are no longer working. Previously, I was using the following imports:

import { Base64 } from '@ionic-native/base64/ngx';
import { IOSFilePicker } from '@ionic-native/file-picker/ngx';

However, after upgrading to Ionic 7, these imports no longer work. After some research, I found that @ionic-native plugins have been replaced with @awesome-cordova-plugins. So, I now need to install them using:

npm i @awesome-cordova-plugins/base64
npm i @awesome-cordova-plugins/file-picker

Additionally, to resolve some dependency issues, I installed a package using the --force flag like this:

npm i native-base64 --force

I am concerned that using --force might cause other issues in the long run.

Could someone clarify the correct approach to handling this transition? Also, is it mandatory to replace @ionic-native with @awesome-cordova-plugins, or is there a way to continue using the older package?

Thanks in advance!

It’s been almost four years since @ionic-native changed to @awesome-cordova-plugins so yes, you should move to @awesome-cordova-plugins. The announcement in 2021 said there would be a two year period of deprecation for the @ionic-native org on npm. It seems it is still around but it could disappear at any point.

It also doesn’t look like @ionic-native packages on npm are being updated anymore so you aren’t going to get any current updates that are made over at @awesome-cordova-plugins.

In regards to dependency issues, the best is to fix them by updating dependent packages or finding a new supported plugin.

https://capawesome.io offers a lot of up-to-date Capacitor plugins that might be good replacements.

1 Like

First of all, I would like to express my sincere thanks. I understand that @ionic-native is no longer maintained and that I should switch to @awesome-cordova-plugins. However, I am unable to add the Base64 and File Picker plugins to my project using a command like:

npm i @awesome-cordova-plugins/base64

My project is entirely based on Cordova, and when updating our old projects, replacing plugins that handle intensive processes requires extra effort, which both my managers and I are hesitant about. Therefore, I am wondering if there is a way to resolve this issue without making too many changes to the existing structure.

Do you have any alternative plugin recommendations?

Thank you very much in advance!

Just to be clear, @awesome-cordova-plugins and @ionic-native are just wrappers/helpers around the underlying Cordova plugin. The underlying plugin for base64 is here. You can use it directly.