gradle なら AndroidManifest.xml 内 <uses-sdk> が不要だった件

_uses-sdk____Android_Developers

Android Studio が警告なフキダシを出してる.

main_AndroidManifest

記述が2箇所あってきもちが悪かったのですが.

build.gradle

android {
    ...
    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 19
    }
    ...
}

AndroidManifest.xml

<uses-sdk
    android:minSdkVersion="9"
    android:targetSdkVersion="19"/>

Android Studio の設定で「バージョン」の記述してるとこありすぎね?

で, AndroidManifest.xml側の記述は不要らしい.

Gradle overrides the manifest values, and I prefer to update build.gradle file rather than manifest. And probably this is the right way using Gradle. Gradle supports product flavours which can be controled via IDE and those product flavors can change many things in our Manifest like package name, version code, version name, target SDK and many other. Then by one click in Android Studio You can change many properties and generate another apk.

You can left the manifest as it is and do all configuration in build.gradle. You can safely remove

<uses-sdk></uses-sdk>

from manifest as well as version codes.

Android studio: why are minSdkVersion and targetSdkVersion specified both in AndroidManifest.xml and build.gradle? - Stack Overflow

Gradle が自動埋め込んでくれるっぽい.

apk化後, バラしてみてみると確認できます.

android-apktool - A tool for reverse engineering Android apk files - Google Project Hosting