What should I set for compileSdkVersion, minSdkVersion, and targetSdkVersion?

前端 未结 4 1440
礼貌的吻别
礼貌的吻别 2020-12-30 10:17

I am concerned about what should I set the compileSdkVersion, minSdkVersion, and targetSdkVersion to be.

  1. My concern

4条回答
  •  天命终不由人
    2020-12-30 10:22

    Your CompileSDKVersion and your TargetSDKVersion should be the same:

    android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"
    
    defaultConfig {
        applicationId "com.judeochalifu.dribsndrabs"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    

    If you are confused on which version number to use, go to Android SDK Manager, locate the API level you are using (Which must always be the latest) and there you will find the version to use (Android 7 (API 24) as at time of writing).

    As for the minSDKVersion, the best place to check which to use is to go to the Create New Project window (Android Studio here), Google will help you choose the best one to use at that moment:

提交回复
热议问题