sflee
sflee

Reputation: 1719

How to select other api level in Android studio?

I am following this tutorial.

I got a Render problem. By searching from web, I found that the api level should be changed to a lower version, link.

The problem is that I cannot select a lower api version: enter image description here
How to solve it?

Upvotes: 0

Views: 39

Answers (2)

sflee
sflee

Reputation: 1719

apply plugin: 'com.android.application'

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

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

Finally, this is my build.gradle.

Upvotes: 0

Diego Malone
Diego Malone

Reputation: 1052

You can set the API level on your app build.gradle file. Open it on ProjectFolder/app/build.gradle.

You can work with a stable Android API (like 27) since Android P API (API level 28) is on Developer Preview stage.

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.app"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
    }
}

Upvotes: 1

Related Questions