Failed to resolve: com.android.support:appcompat-v7:24.4.0 - android

apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "abdulsamadgroup.com.asgroup"
minSdkVersion 11
targetSdkVersion 24
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.0'
compile 'com.android.support:design:24.2.0'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.google.code.gson:gson:2.2.3'
}
and here is details of installed sdk i am using.
Help me solve this problem. I have been searching it from 2 days.

Update your Support Repository .
1st way
Set
compileSdkVersion 24
buildToolsVersion "24.0.2"
And
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
Then Clean-Rebuild-Gradle .
2nd way
You can use latest version,
compileSdkVersion 25
buildToolsVersion "25.0.1"
And
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:design:25.0.1'

Try change compile 'com.android.support:appcompat-v7:24.2.0' to compile 'com.android.support:appcompat-v7:24.4.0'

Please update you JDk version .
For Updating 23.0.0 JDK version is 1.7.
If you wanted to update more 24.0.0 or 25.0.1 your JDK version should be 1.8.
Error:Buildtools 25.0.1 requires Java 1.8 or above. Current JDK version is 1.7.

Related

I can't see the design page and a few other issues

After I update the android studio to version 3.0.1, when I open my project. I have get some error and I can't see the design page but if I run the app. I have no issue.
First this error:
Warning:The specified Android SDK Build Tools version (23.0.3) is
ignored, as it is below the minimum supported version (26.0.2) for
Android Gradle Plugin 3.0.1. Android SDK Build Tools 26.0.2 will be
used. To suppress this warning, remove "buildToolsVersion '23.0.3'"
from your build.gradle file, as each version of the Android Gradle
Plugin now has a default version of the build tools.
The second error:
Failed to load AppCompat ActionBar with unknown error.
This is my build.gradle(app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "ir.hosseinyha.kardoon"
minSdkVersion 16
targetSdkVersion 23
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'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.0.3'
compile 'com.github.bumptech.glide:glide:3.7.0'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
}
Tanks for help
You should upgrade all your com.android.support dependencies to minimum supported versions (26.0.2+).
Also change tarcompileSdkVersion, buildToolsVersion, targetSdkVersion to actual values (26+ but better to support latest - 28). Note that dependencies should have same version as buildTools and targetSdk.

Failed to resolve: com.android.support:appcompat-v7:22.0.0:

Error:
Failed to resolve: com.android.support:appcompat-v7:22.0.0:
How do I solve this error?
Config:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.ummat.qmduain"
minSdkVersion 11
targetSdkVersion 23
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')
compile files('libs/hvjavacal.jar')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.google.android.gms:play-services-ads:7.8.0'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
}
Screenshot:
You are trying to compile version 22, but your compile SDK version is 23.
Solution:
'com.android.support:appcompat-v7:23.4.0'
You have a mismatch in your compile sdkVersion and support library version. You should use 23.0.0 or a newer version in 23.
On a side note, you are on a very old library versions. I would recommend bump up to 27 unless you have some other requirement.

How to change target sdk and compile sdk into 25

I recently updated my android studio in 2.3 . Now I want to change my target sdk and compile sdk into api 25 but which dependency should I compile ? now my target sdk and compile sdk is api 23 and I am compiling the dependency 23.4.0
Thankz in advance
my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.example.application"
minSdkVersion 14
targetSdkVersion 25
versionCode 60
versionName "2.2.6.25"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile('com.android.support:appcompat-v7:23.4.0',
'com.android.support:design:23.4.0',
'com.android.support:cardview-v7:23.4.0',
'com.android.support:recyclerview-v7:23.4.0',
'com.android.support:support-annotations:23.4.0',
'com.android.support:multidex:1.0.1')
compile 'com.itextpdf:itextg:5.5.9'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.google.android.gms:play-services:6.1.71'
testCompile 'junit:junit:4.12'
}
Call :25.1.0 instead of :23.4.0
You should use
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:support-annotations:25.1.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.android.support:support-v4:25.1.0'
and
compileSdkVersion 25
buildToolsVersion '25.0.1'
Go to your project Structure
Then click on app module
Now click on Flavors
There you Edit your Target sdk version and Min sdk version
please check screenshot
Try this
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
...
targetSdkVersion 25
}
}

Issue in Compiling gradle File

It is my build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '23.0.0 rc2'
defaultConfig {
applicationId "com.nanu.admin.notification"
minSdkVersion 8
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'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}
the last two lines showing errors ..how can I solve that in android studio???
Thats because your build version of the project and support version are different change the support library versions
the problem is here
buildToolsVersion '23.0.0 rc2'
Solution : 1
replace builtToolsVersion with 23.0.1 or 23.0.2
Solution : 2
replace
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
with
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
or
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
Since you are using the support libraries v23, you have to compile with api 23.
Change this line :
compileSdkVersion 23
Also change the buildToolsVersion with the latest stable release.
buildToolsVersion '23.0.2'

Gradle project refresh failed with no error details

I was working on a project and updated the Android Studio to 1.5 beta. Also I installed android sdks 22 and 23 via SDK manager. After restart the Gradle is failing to refresh without giving any error details.
Here is my gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.company.projname"
minSdkVersion 14
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'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.0.3'
compile 'com.android.support:cardview-v7:22.0.2'
compile 'com.android.support:design:22.2.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.sothree.slidinguppanel:library:3.2.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.google.code.gson:gson:2.3.1'
}
Whats wrong with this?
Edit: Android Studio Version details
Thanks.

Categories

Resources