Error when running ionic cordova build android

hi when running ionic Cordova build android I am having this error
any help, please
FAILURE: Build failed with an exception.

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

Could not find com.google.firebase:firebase-messaging:15.0.0…
Searched in the following locations:
file:/C:/platform-tools/extras/m2repository/com/google/firebase/firebase-messaging/15.0.0./firebase-messaging-15.0.0…pom
file:/C:/platform-tools/extras/m2repository/com/google/firebase/firebase-messaging/15.0.0./firebase-messaging-15.0.0…jar
file:/C:/platform-tools/extras/google/m2repository/com/google/firebase/firebase-messaging/15.0.0./firebase-messaging-15.0.0…pom
file:/C:/platform-tools/extras/google/m2repository/com/google/firebase/firebase-messaging/15.0.0./firebase-messaging-15.0.0…jar
file:/C:/platform-tools/extras/android/m2repository/com/google/firebase/firebase-messaging/15.0.0./firebase-messaging-15.0.0…pom
file:/C:/platform-tools/extras/android/m2repository/com/google/firebase/firebase-messaging/15.0.0./firebase-messaging-15.0.0…jar
https://maven.google.com/com/google/firebase/firebase-messaging/15.0.0./firebase-messaging-15.0.0..pom
https://maven.google.com/com/google/firebase/firebase-messaging/15.0.0./firebase-messaging-15.0.0..jar
https://jcenter.bintray.com/com/google/firebase/firebase-messaging/15.0.0./firebase-messaging-15.0.0..pom
https://jcenter.bintray.com/com/google/firebase/firebase-messaging/15.0.0./firebase-messaging-15.0.0..jar
https://repo1.maven.org/maven2/com/google/firebase/firebase-messaging/15.0.0./firebase-messaging-15.0.0..pom
https://repo1.maven.org/maven2/com/google/firebase/firebase-messaging/15.0.0./firebase-messaging-15.0.0..jar
Required by:
project :app

Woof, yeah, that looks related to some firebase plugin. First thing I would try is updating the SDKs you have installed. If you’re managing things through Android Studio, just open up your preferences, go to Appearance & Behaviour/System Settings/Android SDK. Then look for something call “Play Services” under the SDK tools tab.

1 Like

thanks that’s helped but I have another error
BUILD FAILED in 3m 32s
cmd: Command failed with exit code 1 Error output:
C:\projects\myApp\platforms\android\app\src\main\AndroidManifest.xml:22:18-91 Error:
Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add ‘tools:replace=“android:appComponentFactory”’ to element at AndroidManifest.xml:5:5-33:19 to override.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:processDebugManifest’.

Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add ‘tools:replace=“android:appComponentFactory”’ to element at AndroidManifest.xml:5:5-33:19 to override

any help please

Typically anything you see like that means you’re missing some support libraries for your project. You have some options here. You can either install a cordova-android plugin for support libraries, or update your cordova-android release to the latest 9.0 which should also fix this.

My vote would be for cordova-android 9.0

1 Like

I’ll try that thank you very much :blush: :blush:

and that’s what happened after updating

  • What went wrong:
    A problem occurred configuring project ‘:CordovaLib’.

Could not resolve all artifacts for configuration ‘:CordovaLib:classpath’.
Could not resolve org.codehaus.groovy.modules.http-builder:http-builder:0.7.2.
Required by:
project :CordovaLib > com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3
Could not resolve org.codehaus.groovy.modules.http-builder:http-builder:0.7.2.
Could not get resource ‘https://jcenter.bintray.com/org/codehaus/groovy/modules/http-builder/http-builder/0.7.2/http-builder-0.7.2.pom’.
Could not HEAD ‘https://jcenter.bintray.com/org/codehaus/groovy/modules/http-builder/http-builder/0.7.2/http-builder-0.7.2.pom’. Received status code 502 from server: Bad Gateway
Could not resolve org.apache.maven:maven-ant-tasks:2.1.3.
Required by:
project :CordovaLib > com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3
Could not resolve org.apache.maven:maven-ant-tasks:2.1.3.
Could not parse POM https://jcenter.bintray.com/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.pom
Could not resolve org.apache.maven:maven-parent:19.
Skipped due to earlier error

1 Like

Did you manage to solve this problem? I´m having the same issue and I can’t get it solved.