2016-06-11 34 views
1

我已经使用minSDKVersion=17从Android Studio创建了一个示例项目。我以app\build\outputs\apk\作为zip文件打开编译好的APK,并进入res目录。它包含了许多旧版本比minSDK旧版本的目录。为什么?它拥有将不会使用的虚假43 KB。为什么编译的APK不尊重minSdkVersion?

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.3" 

    defaultConfig { 
     applicationId "vectordrawable.lelisoft.com.showvectordrawable" 
     minSdkVersion 17 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
     vectorDrawables.useSupportLibrary = true 
    } 
    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:23.4.0' 
    compile 'com.android.support:design:23.4.0' 
} 

APK:

  1. RES \颜色-V11
  2. RES \抽拉-MDPI-V4
  3. RES \布局sw600dp-V13
  4. RES \ Mip映射HDPI-V4

回答

1

所有这些目录都将在API Level 17+设备上有效。 17高于13,11和4.如果没有资源是better match,Android应用程序可能会从这些目录中获取资源。

+0

好的,他们可以使用。例如res \ color-v11 \ abc_background_cache_hint_selector_material_dark.xml。您的意思是说,自从v11以来,所有Android旧版本的APK都存在,直到引入它们? –

+0

@LeosLiterak:AFAIK,该特定资源来自'appcompat-v7',所以它不会存在于不使用'appcompat-v7'的APK中。该特定资源不属于Android SDK AFAIK的一部分。 – CommonsWare