androidxCoreVersion etc

I have a problem in my app that seems to occur on a certain Android 8.1 device and after googling around a bit I wondered if it is due to the androidxCoreVersion value in my app being out of date. When I first migrated this app from Ionic 3 to Ionic 5 I expect I followed the instructions here. In there you are told to create an android/variables.gradle file with the following in:

ext {
  minSdkVersion = 21
  compileSdkVersion = 29
  targetSdkVersion = 29
  androidxAppCompatVersion = '1.1.0'
  androidxCoreVersion =  '1.2.0'
  androidxMaterialVersion =  '1.1.0-rc02'
  androidxBrowserVersion =  '1.2.0'
  androidxLocalbroadcastmanagerVersion =  '1.0.0'
  firebaseMessagingVersion =  '20.1.2'
  playServicesLocationVersion =  '17.0.0'
  junitVersion =  '4.12'
  androidxJunitVersion =  '1.1.1'
  androidxEspressoCoreVersion =  '3.2.0'
  cordovaAndroidVersion =  '7.0.0'

This is currently what I still have set up in my project. Are these androidx values now out of date? I notice that the latest androidxCoreVersion here is now 1.5.

Should the values in the above file always be kept up to date?

In the migration guides we recommend updating those values to the versions we have tested and made sure they work, but of course you can use the version you want.

For Capacitor 3 we recommended updating to 1.3.2 as it was latest stable at the moment of the launch:

It’s weird, I don’t see 1.5.0 final on the maven repository, that’s where I usually check latest versions

The idea of the variables file is to make all plugins and apps to have a common version of all libraries, because having different versions in plugins vs your app causes problems, so having a variable will make capacitor and all plugins that use the variable to use the same version.

It’s usually harmless to update to a newer version, but depends on the library and the version, google doesn’t seem to follow semver, so sometimes a minor version bump break things because they removed something instead of just deprecating. If you update and everything works, then good for you, if not, you’ll have to go back to the previous version.

1 Like