Android Build keeps failing "Could not resolve all files for configuration ':app:releaseCompileClasspath'"

#1

This is in my Ionic Pro console when it starts to fail:

[14:34:15]: ▸ > Task :app:preReleaseBuild FAILED
[14:34:15]: ▸ FAILURE: Build failed with an exception.
[14:34:15]: ▸ * What went wrong:
[14:34:15]: ▸ Could not resolve all files for configuration ':app:releaseCompileClasspath'.
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-tagmanager:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-base:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth:16.1.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-perf:16.2.3
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth-interop:16.0.1
[14:34:15]: ▸ project :app > com.google.firebase:firebase-iid-interop:16.0.1
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-basement:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth:16.1.0
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-flags:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth:16.1.0
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-tasks:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth:16.1.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-messaging:17.4.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-config:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-perf:16.2.3
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth-interop:16.0.1
[14:34:15]: ▸ project :app > com.google.firebase:firebase-common:16.0.3
[14:34:15]: ▸ project :app > com.google.firebase:firebase-iid:17.1.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics-impl:16.3.0
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-basement:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-messaging:17.4.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-config:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-perf:16.2.3
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth-interop:16.0.1
[14:34:15]: ▸ project :app > com.google.firebase:firebase-common:16.0.3
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-measurement-connector-impl:17.0.5
[14:34:15]: ▸ project :app > com.google.firebase:firebase-iid:17.1.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-measurement-connector:17.0.1
[14:34:15]: ▸ project :app > com.google.firebase:firebase-abt:17.1.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics-impl:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-iid-interop:16.0.1
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-clearcut:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-perf:16.2.3
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-phenotype:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-perf:16.2.3
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-measurement-api:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-measurement-connector-impl:17.0.5
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-measurement-base:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-measurement-connector-impl:17.0.5
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics-impl:16.3.0
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-stats:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-iid:17.1.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics-impl:16.3.0
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-ads-identifier:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics-impl:16.3.0
[14:34:15]: ▸ * Try:
[14:34:15]: ▸ Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[14:34:15]: ▸ * Get more help at https://help.gradle.org
[14:34:15]: ▸ BUILD FAILED in 40s
[14:34:15]: ▸ 3 actionable tasks: 3 executed
[14:34:15]: ▸ (node:1175) UnhandledPromiseRejectionWarning: Error: /builds/brandworksbe/hi5-app-v2/platforms/android/gradlew: Command failed with exit code 1 Error output:
[14:34:15]: ▸ FAILURE: Build failed with an exception.
[14:34:15]: ▸ * What went wrong:
[14:34:15]: ▸ Could not resolve all files for configuration ':app:releaseCompileClasspath'.
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-tagmanager:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-base:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth:16.1.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-perf:16.2.3
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth-interop:16.0.1
[14:34:15]: ▸ project :app > com.google.firebase:firebase-iid-interop:16.0.1
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-basement:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth:16.1.0
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-flags:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth:16.1.0
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-tasks:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth:16.1.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-messaging:17.4.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-config:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-perf:16.2.3
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth-interop:16.0.1
[14:34:15]: ▸ project :app > com.google.firebase:firebase-common:16.0.3
[14:34:15]: ▸ project :app > com.google.firebase:firebase-iid:17.1.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics-impl:16.3.0
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-basement:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-messaging:17.4.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-config:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-perf:16.2.3
[14:34:15]: ▸ project :app > com.google.firebase:firebase-auth-interop:16.0.1
[14:34:15]: ▸ project :app > com.google.firebase:firebase-common:16.0.3
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-measurement-connector-impl:17.0.5
[14:34:15]: ▸ project :app > com.google.firebase:firebase-iid:17.1.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-measurement-connector:17.0.1
[14:34:15]: ▸ project :app > com.google.firebase:firebase-abt:17.1.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics-impl:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-iid-interop:16.0.1
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-clearcut:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-perf:16.2.3
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-phenotype:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-perf:16.2.3
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-measurement-api:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-measurement-connector-impl:17.0.5
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-measurement-base:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-measurement-connector-impl:17.0.5
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics-impl:16.3.0
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-stats:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics:16.3.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-iid:17.1.0
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics-impl:16.3.0
[14:34:15]: ▸ > Could not find com.google.android.gms:play-services-ads-identifier:17.0.4.
[14:34:15]: ▸ Required by:
[14:34:15]: ▸ project :app > com.google.firebase:firebase-analytics-impl:16.3.0
[14:34:15]: ▸ * Try:
[14:34:15]: ▸ Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[14:34:15]: ▸ * Get more help at https://help.gradle.org
[14:34:15]: ▸ BUILD FAILED in 40s
[14:34:15]: ▸ at ChildProcess.whenDone (/builds/brandworksbe/hi5-app-v2/node_modules/cordova-common/src/superspawn.js:125:23)
[14:34:15]: ▸ at emitTwo (events.js:126:13)
[14:34:15]: ▸ at ChildProcess.emit (events.js:214:7)
[14:34:15]: ▸ at maybeClose (internal/child_process.js:915:16)
[14:34:15]: ▸ at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
[14:34:15]: ▸ (node:1175) 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)
[14:34:15]: ▸ (node:1175) [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.
[14:34:15]: ------------------------
[14:34:15]: --- Step: upload_apk ---
[14:34:15]: ------------------------
[14:34:15]: ▸ The user-provided path platforms/android/build/outputs/apk/release/android-release.apk does not exist.
+----------------------------+--------------------------------------------------+
|                                 Lane Context                                  |
+----------------------------+--------------------------------------------------+
| DEFAULT_PLATFORM           | ios                                              |
| PLATFORM_NAME              | android                                          |
| LANE_NAME                  | android package_build                            |
| DOWNLOAD_CREDENTIAL_EXISTS | true                                             |
| DOWNLOAD_CREDENTIAL_PATH   | /builds/brandworksbe/hi5-app-v2/android.keystore |
| DOWNLOAD_CREDENTIAL_ALIAS  | deploy-yt-android                                |
+----------------------------+--------------------------------------------------+
[14:34:15]: Shell command exited with exit status 255 instead of 0.

The user-provided path platforms/android/build/outputs/apk/release/android-release.apk does not exist.


+------+-----------------------+-------------+
|              fastlane summary              |
+------+-----------------------+-------------+
| Step | Action                | Time (in s) |
+------+-----------------------+-------------+
| 1    | default_platform      | 0           |
| 2    | build_summary         | 1           |
| 3    | add_git_credentials   | 0           |
| 4    | modify_config_xml     | 0           |
| 5    | build_pro_app         | 39          |
| 6    | add_cordova_to_index  | 0           |
| 7    | download_credential   | 1           |
| 8    | build_android_cordova | 310         |
| 💥   | upload_apk            | 0           |
+------+-----------------------+-------------+

[14:34:15]: fastlane finished with errors
/usr/local/bin/fastlane: [!] Shell command exited with exit status 255 instead of 0. (FastlaneCore::Interface::FastlaneShellError)

The user-provided path platforms/android/build/outputs/apk/release/android-release.apk does not exist.

Running after script...
$ run "clean-up"
ERROR: Job failed: command terminated with exit code 1

I’ve tried numerous ‘solutions’ found online, but none worked so far. What am I doing wrong?
I think the Firebase plugin is causing the fail, because when I removed it and tried to build locally for testing, it succeeded.

Note: I cannot change any gradle files because I must use Ionic Pro (the hot/live deploy feature is necessary for my client).