Reduce Android SDK (api 23 & # 8594; api 21)

Due to some permission issues in the SDK API 23 (Marshmallow), I wanted to return to API 21, but I am facing some problems ... I read so many posts with similar problems and tried (almost me) everything: I updated all the tools SDK builds / platforms, features for API 21, Suport, and repository libraries. Then I cleaned up the project, rebuilt it, and synchronized. However, I get these errors: enter image description here

My build.gradle looks like this:

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 am not very familiar with this, can someone help me fix this cause, I really cannot find a way ...?

+5
source share
1 answer

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 gradle sync button

3 Restructuring Project

+4
source

Source: https://habr.com/ru/post/1237435/


All Articles