Android Builds Failing

Hello Ionic Community,

Can anyone help resolve the following error?

  • What went wrong:
    Could not resolve all files for configuration ‘:app:debugCompileClasspath’.

Could not find any version that matches com.google.android.gms:strict-version-matcher-plugin:[15.0.0, 16.0.0).
Versions that do not match:
1.1.0
1.0.3
1.0.2
1.0.1
1.0.0
Required by:
project :app > com.google.gms:google-services:4.2.0

Ionic Info:

Ionic:

ionic (Ionic CLI) : 4.2.1
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.0
Cordova Plugins : cordova-plugin-ionic 4.1.7, cordova-plugin-ionic-webview 1.1.1, (and 13 other plugins)

System:

NodeJS : v8.12.0 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10

Thanks,
Iqjot

+1

I have been facing the same error. It started two days ago abruptly. I have done all I can even reinstalled android studio and gradle but noting works.

Did you try installing the v3 CLI ? 3.20 ? and you have the 4.1.7 cordova plugin with a v3 project.

Which plugins are you using (the output of ionic cordova plugins)? This error is caused by a version conflict which can sometimes happen if different plugins rely on different versions of library.

You can also try running cordova clean to remove previous android build artifacts.

If all else fails try removing the android project and adding it again: ionic cordova platform remove android

This is my ionic info:

Ionic:

ionic (Ionic CLI) : 4.1.2 (C:\Users\Paul\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.6

Cordova:

cordova (Cordova CLI) : 8.1.0
Cordova Platforms : android 7.1.1
Cordova Plugins : cordova-plugin-ionic-webview 1.2.1, (and 17 other plugins)

System:

Android SDK Tools : 26.1.1 (C:\Users\Paul\AppData\Local\Android\Sdk)
NodeJS : v8.11.4 (C:\Program Files\nodejs\node.exe)
npm : 5.6.0
OS : Windows 10

@webprofusion I have tried removing the platform and adding it again about a thousand times but nothing. I have also tried cordova clean but it has not worked.

This is my plugin list:

cordova plugin ls
cordova-plugin-accountkit 1.4.0 “Cordova AccountKit”
cordova-plugin-camera 3.0.0 “Camera”
cordova-plugin-contacts 3.0.1 “Contacts”
cordova-plugin-device 1.1.7 “Device”
cordova-plugin-facebook4 1.10.1 “Facebook Connect”
cordova-plugin-file 5.0.0 “File”
cordova-plugin-file-transfer 1.7.1 “File Transfer”
cordova-plugin-firebase 0.1.25 “Google Firebase Plugin”
cordova-plugin-geolocation 3.0.0 “Geolocation”
cordova-plugin-googleplus 5.3.2 “Google SignIn”
cordova-plugin-ionic-webview 1.2.1 “cordova-plugin-ionic-webview”
cordova-plugin-media-capture 2.0.0 “Capture”
cordova-plugin-network-information 2.0.1 “Network Information”
cordova-plugin-splashscreen 4.1.0 “Splashscreen”
cordova-plugin-statusbar 2.4.2 “StatusBar”
cordova-plugin-whitelist 1.3.3 “Whitelist”
cordova-sqlite-storage 2.3.1 “Cordova sqlite storage plugin”
ionic-plugin-keyboard 2.2.1 “Keyboard”
onesignal-cordova-plugin 2.4.3 “OneSignal Push Notifications”

Looks like the Google Plus signin plugin has an existing issue for this: https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/77

Same problem here, tried to remove platform and readding it but it didnt work.

This is my cordova plugin list:

cordova-clipboard 1.2.1 "Clipboard"
cordova-plugin-advanced-http 1.11.1 "Advanced HTTP plugin"
cordova-plugin-android-permissions 1.0.0 "Permissions"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-appminimize 1.0 "AppMinimize"
cordova-plugin-background-mode 0.7.2 "BackgroundMode"
cordova-plugin-battery-status 2.0.2 "Battery"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-email-composer 0.8.15 "EmailComposer"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-firebase 1.0.5 "Google Firebase Plugin"
cordova-plugin-globalization 1.11.0 "Globalization"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.1.2 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-mauron85-background-geolocation 2.3.5 "CDVBackgroundGeolocation"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-screen-orientation 3.0.1 "Screen Orientation"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-telerik-imagepicker 2.2.1 "ImagePicker"
cordova-plugin-vibration 3.1.0 "Vibration"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova.plugins.diagnostic 4.0.8 "Diagnostic"
es6-promise-plugin 4.2.2 "Promise"
mx.ferreyra.callnumber 0.0.2 "Cordova Call Number Plugin"
phonegap-plugin-barcodescanner 8.0.0 "BarcodeScanner"

And if I try to remove some plugin like the Firebase one, it crashes too with this weird message:

Uninstalling cordova-plugin-firebase from android
Android Studio project detected
missing file :: app/src/main
Error during processing of action! Attempting to revert...
(node:1121) UnhandledPromiseRejectionWarning: Error: Uh oh!
ENOENT: no such file or directory, open '/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/AndroidManifest.xml'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at Object.parseElementtreeSync (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/node_modules/cordova-common/src/util/xml-helpers.js:180:27)
    at new AndroidManifest (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/lib/AndroidManifest.js:29:20)
    at AndroidProject.getPackageName (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/lib/AndroidProject.js:99:12)
    at AndroidProject.getCustomSubprojectRelativeDir (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/lib/AndroidProject.js:105:28)
    at uninstall (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/lib/pluginHandlers.js:131:46)
    at ActionStack.process (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)
    at PluginManager.doOperation (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:114:20)
    at PluginManager.removePlugin (/Users/smartlogin/Desktop/SmartLogin-android2copia/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:148:17)
(node:1121) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1121) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@webprofusion I have removed the Google Plus plugin completely but the error persists.

My plugins are:

branch-cordova-sdk 3.0.0 “branch-cordova-sdk”
cordova-plugin-camera 4.0.3 “Camera”
cordova-plugin-device 2.0.2 “Device”
cordova-plugin-file 6.0.1 “File”
cordova-plugin-firebase 1.0.5 “Google Firebase Plugin”
cordova-plugin-geolocation 4.0.1 “Geolocation”
cordova-plugin-inappbrowser 3.0.0 “InAppBrowser”
cordova-plugin-ionic 4.1.7 “IonicCordova”
cordova-plugin-ionic-webview 1.1.19 “cordova-plugin-ionic-webview”
cordova-plugin-network-information 2.0.1 “Network Information”
cordova-plugin-splashscreen 5.0.2 “Splashscreen”
cordova-plugin-whitelist 1.3.3 “Whitelist”
cordova-sqlite-storage 2.4.0 “Cordova sqlite storage plugin”
ionic-plugin-keyboard 2.2.1 “Keyboard”
onesignal-cordova-plugin 2.4.3 “OneSignal Push Notifications”

Is onesignal required? The firebase plugin also looks pretty old and you could try updating it.

Note that for all Android apps you now need to target the SDK level 26 in order to submit app updates via Google Play, which can also result in some things needing updated as well, so it’s generally worth keeping your plugins up to date.

Thank you for your help and suggestions. Turns out the firebase plugin was the culprit. I verified this by uninstalling it and then building my app with success. I resolved this error with the following steps:

  • delete /platforms/android folder (take backup first for safety)
  • ionic cordova plugin remove cordova-plugin-firebase
  • ionic cordova run android (confims that app will build/run but console displays warnings of “missing cordova-plugin-firebase” <= which is expected)
  • ionic cordova plugin add cordova-plugin-firebase@2.0.5
  • ionic cordova run android

Ultimately it was a matter of updating the firebase plugin.

2 Likes