构建错误Ionic Android:构建因异常而失败

时间:2015-10-14 21:00:36

标签: android cordova google-cloud-messaging ionic

我尝试为Android构建一个离子应用程序,我发现了这个错误:

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支持库和Android支持存储库。

感谢您的帮助

编辑:

我尝试更新cordova和cordova-cli,但它没有用。

2 个答案:

答案 0 :(得分:6)

位置https://repo1.maven.org/maven2/com/android/support/不再存在(404)。所以maven配置似乎是个问题。

我发现a GitHub issue有关您遇到的同一问题,并通过运行更新SDK(您已经这样做)并将Android平台读入Ionic项目来解决:

# 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

答案 1 :(得分:2)

请参阅此related question中的答案。

简而言之:错误的来源可能是一个依赖于com.android.support:support-v4支持库的插件。

如果您使用cordova> = 5.0.0更新到新的官方插件。

相关问题