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
Related
I am trying to add this dependency to gradle, but I am receiving the below errors about other dependencies which I have not added in the first Place.
Errors :
Dependency I am trying to add is com.wdullaer:materialdatetimepicker:3.1.3
build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.pf.datetimepicker"
minSdkVersion 21
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
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:+'
compile 'com.wdullaer:materialdatetimepicker:3.1.3'
}
which I have not added in the first Place.
Sure you did...
Look at the source of the library you got. https://github.com/wdullaer/MaterialDateTimePicker/blob/master/library/build.gradle
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:support-v13:25.2.0'
compile 'com.android.support:design:25.2.0'
First, you need compileSdkVersion 25 for those to even work, then you need to allow Android Studio to "Install Repository and Sync Project" or do it yourself by updating the SDK Manager.
Change your compile and targetsdk to 25
Change your compileSdkVersion, buildToolsVersion andtargetSdkVersion
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.pf.datetimepicker"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
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:+'
compile 'com.wdullaer:materialdatetimepicker:3.1.3'
}
You have not installed the newest version of android support libraries. Just open SDK manager and install them. See the image
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
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
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.
Android Studio does not provide me all methods of the "Bundle"-class.
When I want to use .getString(), it shows me as an error. I have no clue why !?!?!
That is my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "test.android.com.test"
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile project(':facebook')
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.nineoldandroids:library:2.4.+'
compile 'com.android.support:support-v13:20.0.+'
compile 'com.google.android.gms:play-services:4.2.42'
compile 'com.mcxiaoke.volley:library:1.0.6'
}
Finally I found a solution. If someone has the same problem here you go.
Change from:
compileSdkVersion 20
buildToolsVersion "20.0.0"
Change to:
compileSdkVersion 19
buildToolsVersion "19.0.0"