我正在使用带有外部 Android SDK 的 Android Studio。我已经安装了支持库和支持存储库。支持存储库位于:
~/Development/Tools/android/sdk/extras/android/m2repository
当我向文件中的支持库添加依赖项时build.gradle
,例如:
...
repositories {
mavenCentral()
}
...
dependencies {
compile "com.android.support:support-v4:18.0.+"
}
Android Studio 找不到支持库(无法解析符号等),Gradle 也找不到这些库:
Gradle: A problem occurred configuring project ':TestAndroidStudio'.
> Failed to notify project evaluation listener.
> Could not resolve all dependencies for configuration ':TestAndroidStudio:_DebugCompile'.
> Could not find any version that matches com.android.support:support-v4:18.0.+.
Required by:
TestAndroidStudio:TestAndroidStudio:unspecified
如何在 Android Studio 和/或build.gradle
文件中指定 Android 支持存储库的位置?