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.

amiceli
  • 437
  • 5
  • 11
  • 29
  • 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](http://cordova.apache.org/news/2015/09/22/tools-release.html). –  Oct 16 '15 at 02:56
  • unless your respond in a message box, I do not know if you have responded. [Forums that support Cordova/Phonegap](https://github.com/jessemonroy650/top-phonegap-mistakes/blob/master/cordova-phonegap-forums.md) ------ [Ionic forum](http://forum.ionicframework.com/) –  Oct 18 '15 at 03:16
  • Were you able to install the Android Support Library in your SDK Manager? – Rene Padillo Oct 18 '15 at 12:53
  • I've installed SDK Manager with Android Studio. – amiceli Oct 19 '15 at 09:13

2 Answers2

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
tynn
  • 38,113
  • 8
  • 108
  • 143
  • 1
    Before removing the android platform: Be sure to backup any ressources like icons, translations...! – Andre Kreienbring Oct 24 '15 at 10:24
  • If above answer not helped please see this http://stackoverflow.com/questions/40383323/cant-accept-license-agreement-android-sdk-platform-24/40383457#40383457 – cfprabhu Apr 01 '17 at 15:57
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.

Community
  • 1
  • 1
Andre Kreienbring
  • 2,457
  • 11
  • 16