Build error Ionic Android : Build failed with an exception
Asked Answered
T

2

6

I try to build an ionic app for android and I've this error :

What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
   > Could not find any version that matches com.android.support:support-v4:+.
 Searched in the following locations:
     https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml
     https://repo1.maven.org/maven2/com/android/support/support-v4/
 Required by:
     :android:unspecified

Android Support Library and Android support Repository are installed.

Thank for your help

EDIT:

I try to update cordova and cordova-cli but it didn't work.

Tripetalous answered 14/10, 2015 at 21:0 Comment(4)
Upgrade you system, see if it helps. The current Cordova Tools version is 5.3.3. Here is a blog post that should help with the upgrade.Inpour
unless your respond in a message box, I do not know if you have responded. Forums that support Cordova/Phonegap ------ Ionic forumInpour
Were you able to install the Android Support Library in your SDK Manager?Samuels
I've installed SDK Manager with Android Studio.Tripetalous
T
6

The location https://repo1.maven.org/maven2/com/android/support/ does not exist anymore (404). So the maven configuration seems to be the issue.

I found a GitHub issue about the same problem you encountered and it was solved by running updating the SDK (which you did already) and readding the Android platform to the Ionic project:

# Update Android SDK
android list sdk
android update sdk --no-ui --filter extra

# Refresh Ionic Android configuration
ionic platform remove android
ionic platform add android
Tinaret answered 20/10, 2015 at 11:38 Comment(2)
Before removing the android platform: Be sure to backup any ressources like icons, translations...!Honshu
If above answer not helped please see this #40383823Whisker
N
2

Please see my answer in this related question.

In short: the source of the error maybe an plugin that depends on the com.android.support:support-v4 support library.

If you use cordova >= 5.0.0 update to the new official plugins.

Neville answered 21/10, 2015 at 9:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.