Sorry for my english. I update in compileSdkVersion 23 but my project use org.apache.http* and all is crash. I want compile in compileSdkVersion 22 what I before do. But if I change this, I have error
Error:(2) Error retrieving parent for item: No resource found that
matches the given name
'android:TextAppearance.Material.Widget.Button.Inverse'.
And I don't know how fix this. My gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
defaultConfig {
applicationId "com.home.smart.home"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile project(":slidingLibrary")
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
}
but project still have this:
How I can use appCompat v22 ?
I think the problem is in the last line of your code that is
compile 'com.android.support:appcompat-v7:22.2.0'
You & I updated the appcompat to 23.0.0. I'm not able to run it as 22 but if you change it to 23 you will be able to run your project.... my build.gradle module:app file is like below & is working good
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.example.inzi.app"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
}
set the compileSdkVersion to 23 as line 3 below & at last line, check the latest code it may help you
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.example.inzi.app"
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
}
If you are using the support libraries v23 you have to use compileSdkVersion 23 otherwise you can have some issues like
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse.
You can use the support libraries v22 if you want to compile with API22.
The API 23 (Android 6.0) removed the Apache HTTP client and the package org.apache.http* .
You can read more info here.
You can use the HttpURLConnection class instead or you can switch to OkHttp.
Related
I have a problem with Gradle !!
It keeps showing me errors , can some one help me to resolve this problem
Note: It's my first time to install android studio
Try using this:
compile 'com.android.support:appcompat-v7:24.1.0'
Use latest support library and change your target and compile sdk also
compileSdkVersion 24
buildToolsVersion "24.0.1"
targetSdkVersion 24
Try it
compile "com.android.support:appcompat-v7:23.0.1"
and you can change targetSdkVersion 23
Please use my project gradle values and also update sdk libraries:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
multiDexEnabled true
applicationId "com.example.student" //change as your package name
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
}
Try to match all versions:
compileSdkVersion 23
buildToolsVersion '23.0.0'
targetSdkVersion 23
Add Following dependencies:
compile 'com.android.support:appcompat-v7:23.0.0'
Make sure you use latest version of Sdk:
how to update sdk
The problem is you're using
compile 'com.android.support:appcompat-v7:19.+'
which gives you all possibilities of Android 4.4.2 Kitkat API 19 and older.
In your project you're trying to use Material Themes which belongs to newer version, I mean com.android.support:appcompat:$version, where version > 21.
Material Design was introduced with Android 5.1 Lollipop API 21
I higly reccomend you to change your build.gradle file to:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
minSdkVersion 21
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile "com.android.support:appcompat-v7:24.2.1"
}
but of course changing appcompat library to version :
com.android.support:appcompat-v7:23.0.1"
would be enough ;-)
Hope it would help
I am getting following error :
Error:(1) Error retrieving parent for item: No resource found that
matches the given name
'android:TextAppearance.Material.Widget.Button.Inverse'. in values
v-23.xml
Here is my gradle file :
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.ashwin_bhoyar.techtt"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.0.0-alpha1'
compile 'com.google.android.gms:play-services:8.4.0'
}
No resource found that matches the given name
'android:TextAppearance.Material.Widget.Button.Inverse'
You should call API Level 23
compileSdkVersion 23
buildToolsVersion "23.1.0"
defaultConfig {
applicationId "com.example.ashwin_bhoyar.techtt"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
And use
compile 'com.android.support:appcompat-v7:23.1.0'
Please add this to your gradle.
compile 'com.android.support:appcompat-v7:23.1.0'
Hope this would work
I edited your gradle code ............try to this,I hope's its works
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.ashwin_bhoyar.techtt"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.1.2'
compile 'com.google.android.gms:play-services:8.4.0'
}
Your compile SDK version must match the support library's major version.
Since you are using version 23 of the support library, you need to compile against version 23 of the Android SDK.
Alternatively you can continue compiling against version 21 of the Android SDK by switching to the latest support library v21.
Please check The highlighted Part Of image
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:
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..?
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
Android Studio was telling me it couldn't resolve some symbols in my code. After research, it was apparent that my project was API level 23, which wasnt compatible with some of the code. I decided to change it to API level 21.
Below is the previous code in my build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.scriptdesigninc.test_app"
minSdkVersion 8
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
}
I was told that I have to change it to the following,
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.scriptdesigninc.test_app"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
}
After I changed it, it told me I am missing the API package and that I have to download it, which I did. Then I clicked "retry" and it said it was unable to sync gradle project.
Please help, thank you in advance.
dependencies {
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
}
Add the above dependency in your build.gradle file.
This is happening because Android M does not supports the Apache HTTP API
I followed the all of related question for this error and i tried :
1.changing the theme of the preview activity
//but I dont need this. It just changes the preview action bar (or other something) and I dont need this. (material personal app_theme)
2.change to API-21.
//This also fixes this error but we cannot see any action bar anymore with this option.
So, my Android Studio Version is:
1.2.1.1
I'm using API-22.
Build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
defaultConfig {
applicationId "test.myapplication"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
defaultConfig {
applicationId "test.myapplication"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
}
How to fix this?
After update the Android Studio to AI 141.1962279 From Canary Channel and i added this one on the Build.gradle and it's seems work now.
compile 'com.android.support:support-v4:22.1.1'