Android Studio 修改api level
原创
©著作权归作者所有:来自51CTO博客作者james_karon的原创作品,请联系作者获取转载授权,否则将追究法律责任
- Update build.gradle
Example of build.gradle: app/src/build.gradle
apply plugin:'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.courses.sottocorp.sunshine"
minSdkVersion 10
targetSdkVersion 20
versionCode 1
versionName "1.0"}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'}}}
dependencies {
compile fileTree(dir:'libs', include:['*.jar'])
compile 'com.android.support:appcompat-v7:20.0.0'
compile 'com.android.support:support-v4:20.0.0'}
- Sync gradle button
- Rebuild project
After updating the build.gradle minSdkVersion, you have to click on the button to sync gradle file ("Sync Project with Gradle files").
That will clear the market.
Updating manifest.xml, e.g. deleting any references to SDK levels in the manifest file, is NOT necessary anymore in Android Studio.