Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build error Ionic Android : Build failed with an exception

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.

like image 756
amiceli Avatar asked Oct 14 '15 21:10

amiceli


2 Answers

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
like image 183
tynn Avatar answered Oct 23 '22 16:10

tynn


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.

like image 25
Andre Kreienbring Avatar answered Oct 23 '22 16:10

Andre Kreienbring