久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何將 Android 支持存儲庫添加到 Android Studio?

How to add Android Support Repository to Android Studio?(如何將 Android 支持存儲庫添加到 Android Studio?)
本文介紹了如何將 Android 支持存儲庫添加到 Android Studio?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在使用帶有外部 Android SDK 的 Android Studio.我已經安裝了支持庫和支持存儲庫.支持存儲庫位于:

I'm using Android Studio with an external Android SDK. I have installed the support library and the support repository. The support repository is in:

~/Development/Tools/android/sdk/extras/android/m2repository

當我在 build.gradle 文件中向支持庫添加依賴項時,例如:

When I add a dependency to the support library in the build.gradle file, like:

...

repositories {
    mavenCentral()
}

...

dependencies {
   compile "com.android.support:support-v4:18.0.+"
}

Android Studio 找不到支持庫(無法解析符號等),Gradle 也找不到這些庫:

Android Studio cannot find the support libraries (cannot resolve symbol etc) and Gradle also cannot find the libraries:

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 支持存儲庫的位置?

How do I specify in Android Studio and/or the build.gradle file the location of the Android support repository?

推薦答案

你可能被 此錯誤 阻止 Android Gradle 插件自動將Android 支持存儲庫"添加到 Gradle 存儲庫列表中.如錯誤報告中所述,解決方法是將 m2repository 目錄顯式添加為頂級 build.gradle 文件中的本地 Maven 目錄,如下所示:

You are probably hit by this bug which prevents the Android Gradle Plugin from automatically adding the "Android Support Repository" to the list of Gradle repositories. The work-around, as mentioned in the bug report, is to explicitly add the m2repository directory as a local Maven directory in the top-level build.gradle file as follows:

allprojects {
    repositories {
        // Work around https://code.google.com/p/android/issues/detail?id=69270.
        def androidHome = System.getenv("ANDROID_HOME")
        maven {
            url "$androidHome/extras/android/m2repository/"
        }
    }
}

這篇關于如何將 Android 支持存儲庫添加到 Android Studio?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出現 IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中獲取當前風味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修復“意外元素lt;查詢gt;在“清單中找到錯誤?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多風味庫的多風味應用)
Android dependency has different version for the compile and runtime(Android 依賴在編譯和運行時有不同的版本)
Transitive dependencies for local aar library(本地 aar 庫的傳遞依賴)
主站蜘蛛池模板: 天堂一区二区三区四区 | 在线观看免费av片 | 国产三级在线观看播放 | 欧美日韩亚洲国产 | 在线免费毛片 | 国产激情一区二区三区 | 亚洲国产视频一区二区 | 国产成人高清在线观看 | www.97国产| 91精品亚洲| 逼逼视频 | 日产久久 | 91视频免费在观看 | 国产91黄色 | 亚洲影音先锋 | 在线免费观看黄色av | 欧美日韩在线高清 | 免费在线色 | 欧美高清视频一区 | 蜜桃臀av一区二区三区 | 欧美精选一区二区 | 亚洲国产精品久久久 | 国产午夜精品一区二区三区四区 | 超碰人人91 | 成人免费在线视频 | a在线视频| 日韩成人在线一区 | аⅴ资源新版在线天堂 | 激情欧美一区二区三区中文字幕 | 国产午夜av片 | 在线视频一区二区三区 | 一区视频在线播放 | 亚洲欧美国产精品一区二区 | 国产成人高清 | 国产欧美一区二区在线观看 | 亚洲图片一区二区三区 | 国产成人精品亚洲日本在线观看 | 欧美日韩高清 | 日韩欧美国产不卡 | 精品一二区 | 青久草视频 |