Build error Ionic Android : Build failed with an e

2019-04-29 03:55发布

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.

2条回答
Deceive 欺骗
2楼-- · 2019-04-29 04:50

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
查看更多
【Aperson】
3楼-- · 2019-04-29 04:54

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.

查看更多
登录 后发表回答