How much to update but still be on Ionic 3?

Our company is in the process of moving all ionic apps to native mobile. I get the lucky assignment of maintaining the old ionic v3 apps for now. I need to do a prod move. Haven’t done one in six months. Also moving from linux to windows. (For android releases).

Seeing what I can update now and still be on ionic 3?

I had problems with this cordova-android-support-gradle-release plugin, which shouldn’t be needed anymore?
Tried updating Cordova to 9 but getting this problem

Can I leave angular code the same, leave ionic-native the same, but update my other plugins?
Or is this all or nothing?

npm outdated

Package                                 Current  Wanted   Latest
@angular/common                           5.0.0   5.0.0  12.2.11
@angular/compiler                         5.0.0   5.0.0  12.2.11
@angular/compiler-cli                     5.0.0   5.0.0  12.2.11
@angular/core                             5.0.0   5.0.0  12.2.11
@angular/forms                            5.0.0   5.0.0  12.2.11
@angular/http                             5.0.0   5.0.0   7.2.16
@angular/platform-browser                 5.0.0   5.0.0  12.2.11
@angular/platform-browser-dynamic         5.0.0   5.0.0  12.2.11
@ionic-native/android-fingerprint-auth   4.20.0  4.20.0   5.36.0
@ionic-native/core                        4.3.2   4.3.2   5.36.0
@ionic-native/file                       4.20.0  4.20.0   5.36.0
@ionic-native/file-opener                4.20.0  4.20.0   5.36.0
@ionic-native/firebase                   4.20.0  4.20.0   5.36.0
@ionic-native/geolocation                4.20.0  4.20.0   5.36.0
@ionic-native/in-app-browser             4.20.0  4.20.0   5.36.0
@ionic-native/keychain                   4.20.0  4.20.0   5.36.0
@ionic-native/native-storage             4.20.0  4.20.0   5.36.0
@ionic-native/network                    4.20.0  4.20.0   5.36.0
@ionic-native/splash-screen              4.20.0  4.20.0   5.36.0
@ionic-native/status-bar                  4.3.2   4.3.2   5.36.0
@ionic-native/touch-id                   4.20.0  4.20.0   5.36.0
@ionic/storage                            2.0.1   2.0.1    3.0.6
cordova-plugin-androidx                   1.0.2   1.0.2    3.0.0
cordova-plugin-device                     1.1.7   1.1.7    2.0.3
cordova-plugin-file-opener2               2.2.1   2.2.1    3.0.5
cordova-plugin-firebase-lib               4.1.0   4.1.0    5.1.1
cordova-plugin-inappbrowser               4.1.0   4.1.0    5.0.0
cordova-plugin-network-information        2.0.2   2.0.2    3.0.0
cordova-plugin-splashscreen               5.0.4   5.0.4    6.0.0
ionic-angular                             3.9.2   3.9.2   3.9.10
ionicons                                  3.0.0   3.0.0    5.5.3
rxjs                                      5.5.0   5.5.0    7.4.0
typescript                                2.4.2   2.4.2    4.4.4
zone.js                                  0.8.18  0.8.18   0.11.4

Thanks

Ionic v3 does not support any angular version past 5.0, so your best bet honestly is to either

  • keep things as they are.
  • migrate fully over to the newer Ionic releases.

I’d say go for the full upgrade since we’re v3 is over 4 years old.

For the native bits, I’d say try to update to capacitor vs trying to stay on cordova.

Thanks for the info.
Is capacitor free? I haven’t looked much into that.

Update on where I’m at – I updated Cordova to v10 and cordova-android to 9.1 I think.
After sorting out some things with AndroidX I was able to do a dev build. I thought I was good, but when I do a prod build (with the flag --prod) was getting errors. I should have left it there…

Decided to try to go down a version of Cordova and android see if that would work, in that process I deleted the node_modules folder and was trying to install ionic 3. npm install -g ionic@3
But when I try to run the code in the browser getting errors

Cannot find module ‘ionic-angular’.
and Cannot find module ‘@ionic-native/android-fingerprint-auth’.

So now I don’t even know how to get ionic 3 installed on windows again.
Any suggestions-- help?

Here is my ionic info on windows 10. Looks like its all installed correctly

cli packages: (C:\Users\w437982\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.3
ionic (Ionic CLI) : 3.20.1

global packages:

cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)

local packages:

@ionic/app-scripts : 3.2.4
Cordova Platforms  : android 8.1.0
Ionic Framework    : ionic-angular 3.9.2

System:

Node : v14.17.2
npm  : 6.14.13
OS   : Windows 10

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro

Don’t do that. The @ionic/cli is the thing that’s installed globally, and you always want the latest version of it.

As for your jacked-up node installation, I would suggest installing nvm-windows and using it to manage things.

Hmmm I let it install the latest.
Ionic Info

Ionic:

Ionic CLI : 5.4.16 (C:\Users\w437982\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.4

Cordova:

Cordova CLI : 10.0.0 (cordova-lib@10.1.0)
Cordova Platforms : android 9.1.0, browser 6.0.0
Cordova Plugins : cordova-plugin-ionic-webview 5.0.0, (and 12 other plugins)

But back to where I started.
Cannot find module ‘ionic-angular’.
Cannot find module ‘@ionic-native/keychain’.

Any way to verify these are getting installed?
Any other suggestions would be helpful.

@mhartington gave you two suggestions. If you’re taking the “keep things where they are” option, I would revert using version control to exactly where you were before you started touching anything. If you’re upgrading, you don’t want “ionic-angular”. It’s obsoleted by @ionic/angular.

Yep, thanks, did start over. Building again and it looks familiar.
For better or worst I guess this is about as much “upgrading” possible.

@ionic/cli-utils  : 1.19.3
ionic (Ionic CLI) : 3.20.1

global packages:

cordova (Cordova CLI) : 10.0.0 (cordova-lib@10.1.0)

local packages:

@ionic/app-scripts : 3.2.4
Cordova Platforms  : android 9.1.0 browser 6.0.0
Ionic Framework    : ionic-angular 3.9.10

Back to the problem I had before. Building a dev Android version works fine. Building a prod (–prod flag)version builds the APK but when I try to run it, I get this error as the app is loading. The app login screen does come up but buttons don’t work, they just keep giving the same error.

vendor.js:formatted:3023 ERROR Error: StaticInjectorError[l]: 
  StaticInjectorError[l]: 
    NullInjectorError: No provider for l!
    at t.get (vendor.js:formatted:2950)
    at vendor.js:formatted:271
    at f (vendor.js:formatted:274)
    at t.get (vendor.js:formatted:2993)
    at vendor.js:formatted:271
    at f (vendor.js:formatted:274)
    at t.get (vendor.js:formatted:2993)
    at te (vendor.js:formatted:1151)
    at t.get (vendor.js:formatted:5582)
    at Ee (vendor.js:formatted:1472)

I think there is a way to build for prod but not obfuscate? so I can get more info?
Thanks again for your help.

Hey, is there a particular reason why you are moving to windows?
You can develop Android releases while on linux.
If it’s a personal choice, all good. If you feel Android is forcing you, perhaps it is not that way.
Cheers,
Gustavo.