Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while changing API level from 23 to 22

I want to change the minimum SDK version in Android Studio from API 23 to API 22 as HttpClient is not supported in API 23.I have tried changing it in build.gradle(Module:app) ie I have changed the compileSdkVersion from 23 to 22 and targetSdkVersion from 23 to 22.

android {
compileSdkVersion 23
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.test.gcmgreetingapp"
    minSdkVersion 11
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.google.android.gms:play-services:7.8.0'
compile project(':android-query-full.0.26.7')
compile 'com.loopj.android:android-async-http:1.4.8'
}

Then, sync and rebuild the project. But i got the following error in gradle console

AGPBI: {"kind":"error","text":"Error retrieving parent for item: No resource found that matches the given name \u0027android:TextAppearance.Material.Widget.Button.Inverse\u0027.","sources":[{"file":"C:\\Users\\nischal.manandhar\\AndroidStudioProjects\\GCMGreetingApp\\app\\build\\intermediates\\exploded-aar\\com.android.support\\appcompat-v7\\23.0.0\\res\\values-v23\\values-v23.xml","position":{"startLine":1}}],"original":""}
AGPBI: {"kind":"error","text":"Error retrieving parent for item: No resource found that matches the given name \u0027android:Widget.Material.Button.Colored\u0027.","sources":[{"file":"C:\\Users\\nischal.manandhar\\AndroidStudioProjects\\GCMGreetingApp\\app\\build\\intermediates\\exploded-aar\\com.android.support\\appcompat-v7\\23.0.0\\res\\values-v23\\values-v23.xml","position":{"startLine":1}}],"original":""}


FAILED

FAILURE: Build failed with an exception.

The error is in the file v23\values-v23.xml

Any help will be greatly appreciated. Thanks!!!

like image 499
Nischal Avatar asked Dec 25 '22 15:12

Nischal


2 Answers

Change it in your AndroidManifest.xml

    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22" />

Cheers

like image 199
GOSCHEN Avatar answered Dec 27 '22 04:12

GOSCHEN


Try changing

compile 'com.android.support:appcompat-v7:23.0.0'

To

compile 'com.android.support:appcompat-v7:22.2.0'

Do this alongwith compileSdkVersion targetSdkVersion set to 22

like image 23
Adeel Ahmad Avatar answered Dec 27 '22 05:12

Adeel Ahmad