Search code examples
androidsdkproject-settings

How can i change AndroidStudio project to a lower sdk


I currently run :

AndroidStudio 2.2 , Android sdk 24 is also available. Android SDK-Tools 25.2.2 Android Sdk-Platform-tools 24.03 Android sdk-build-tools 24.0.1

When i create a new Blank Project this is the build gradle

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"
    defaultConfig {
        applicationId "com.example.test001"
        minSdkVersion 14
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:design:24.2.1'
    testCompile 'junit:junit:4.12'
}

I would assume this is an app that can be installed on devices running 4.0 to 7.0 How can i change this so that it runs from 2.3.3 to 6.0, still working from the same AndroidStudio installation.Also how would it affect the other features like google-play-services, appcompat-v7,design versions.


Solution

  • android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    defaultConfig {
        applicationId "com.example.test001"
        minSdkVersion 10
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    

    And Change Your Dependency Also

    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:design:23.1.0'