Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downgrade Android SDK( api 23 -> api 21)

Due to some problems with permissions in SDK API 23 (Marshmallow) I wanted to switch back to API 21, yet I'm encountering some issues... I've read so many posts with similiar problems and tried (almost I guess) everything: I've updated all SDK Build/Platform Tools, features for API 21, Suport and Repository Libraries. Then I've cleaned up the project, rebuilt it and synchronized. Yet, I'm getting those errors: enter image description here

My build.gradle looks like following:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"
    defaultConfig {
        applicationId "com.example.pablo.appcontacts"
        minSdkVersion 19
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.android.support:appcompat-v7:23.1.1'
}

I'm not very familiar with this, can anybody help me to fix this cause I really can't find a way to..?

like image 842
Paweł Poręba Avatar asked Sep 27 '22 00:09

Paweł Poręba


1 Answers

3 Steps:

1 Edit build.grade

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.stackoverflow.answer"
        minSdkVersion 16
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

dependencies {
    androidTestCompile 'junit:junit:4.12'
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

2 Sync gradle button

3 Rebuild project

like image 57
josedlujan Avatar answered Sep 29 '22 23:09

josedlujan