简体   繁体   English

如何更改目标SDK并将其编译为25

[英]How to change target sdk and compile sdk into 25

I recently updated my android studio in 2.3 . 我最近在2.3中更新了我的android studio。 Now I want to change my target sdk and compile sdk into api 25 but which dependency should I compile ? 现在我想更改目标sdk并将sdk编译为api 25但是我应该编译哪个依赖项? now my target sdk and compile sdk is api 23 and I am compiling the dependency 23.4.0 现在我的目标sdk和编译sdk是api 23 ,我正在编译依赖项23.4.0

Thankz in advance 预先感谢

my gradle file 我的gradle文件

  apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion '25.0.0'

defaultConfig {
    applicationId "com.example.application"
    minSdkVersion 14
    targetSdkVersion 25
    versionCode 60
    versionName "2.2.6.25"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false

        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
lintOptions {
    checkReleaseBuilds false
 }
}



dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile('com.android.support:appcompat-v7:23.4.0',
        'com.android.support:design:23.4.0',
        'com.android.support:cardview-v7:23.4.0',
        'com.android.support:recyclerview-v7:23.4.0',
        'com.android.support:support-annotations:23.4.0',
        'com.android.support:multidex:1.0.1')
compile 'com.itextpdf:itextg:5.5.9'
compile 'com.android.support:support-v4:23.4.0'

compile 'com.google.android.gms:play-services:6.1.71'
testCompile 'junit:junit:4.12'
}

Call :25.1.0 instead of :23.4.0 致电:25.1.0而不是:23.4.0

You should use 你应该用

compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:support-annotations:25.1.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.android.support:support-v4:25.1.0'

and

compileSdkVersion 25
buildToolsVersion '25.0.1'
  1. Go to your project Structure 转到您的项目结构
  2. Then click on app module 然后点击应用模块
  3. Now click on Flavors 现在单击风味
  4. There you Edit your Target sdk version and Min sdk version 在那里,您可以编辑目标sdk版本和最低sdk版本

please check screenshot 请检查截图

Try this 尝试这个

android {
  compileSdkVersion 25
  buildToolsVersion '25.0.2'
  defaultConfig {
    ...
    targetSdkVersion 25
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM