Android Studio decide the exact version of a dependency to use

For example, when we need to edit app/build.gradle, we need to declare the dependency version:

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "com.example.user.test"
        minSdkVersion 18
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:26...'
    compile 'com.android.support:support-annotations:26....'
    androidTestCompile 'com.android.support:support-annotations:26...'
    androidTestCompile 'com.android.support.test:runner:0.5'
    androidTestCompile 'com.android.support.test:rules:0.5'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
}

But how to make sure which exact version is included in version 26?

compile 'com.android.support:appcompat-v7:26...'

Just first type :

compile 'com.android.support:appcompat-v7:26.+'

Do not forget the "."!
And do sync, then focus on this dependency, ALT + ENTER, choose
Replace with specific version, and it's done :

compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 11,086評論 0 23
  • 那時花開,是草長鶯飛,萬物蔥蘢的一派景象。天地不知何時從混沌中,豁地一下開了一道口子,無限的霞光從彼處灑下來??此?..
    安安的歌閱讀 348評論 0 4
  • 工作,啟動我的能量。我喜歡精神飽滿,笑容燦爛,目光有神的自己。那樣的狀態(tài),散發(fā)出層層的能量,每層能量都散...
    智愛189閱讀 149評論 0 0
  • 周末,和老公一起去看望他的大學同學和家人,同學老婆剛生完二胎,兒女雙全,有房有車,工作穩(wěn)定,早已辦好了上海戶口,短...
    人間八月閱讀 299評論 0 1
  • 喜歡一個人總是笨拙的。我總是在想如果那天能重來就好了。無法回頭也無法前進。安慰自己這是結果,表面無所謂的我一直在期...
    小圓sky閱讀 208評論 0 0

友情鏈接更多精彩內容