I\'m currently working on an ionic4 application, but recently it stopped working while building the application on an android reall device after adding https://ionicframewor
Your project (or one of its sub-projects) is referring to a dependency using the + plus-sign at its end, like com.google.firebase:firebase-auth:+
, which means, use any higher version when possible, and that newer version is no longer using android.support
libraries and instead is using androidx
; to fix this issue follow the below steps.
ANDROID_HOME
environment-variable is set, and then, open a console window (like git-bash, because it keeps the whole command output), and cd
into your android
directory (for Ionic projects it should be platforms/android
)../gradlew :app:dependencies
androidx
.16.0.8 -> 19.0.0
or + -> 19.0.0
, which both mean that the version was auto-resolved (to something higher than specified by you because of +).clear
the console).To Force specific version of the dependencies add to your root build.gradle
something like below (which is what worked for me) but edit and add your own rules (if these do not work for you):
allprojects {
// ...
configurations.all {
resolutionStrategy {
force 'com.google.firebase:firebase-common:17.0.0'
force 'com.google.android.gms:play-services-basement:16.2.0'
force 'com.google.firebase:firebase-iid:16.0.0'
force 'com.google.firebase:firebase-auth:17.0.0'
}
}
}