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.
Related
Can't compile it and can't see in my library.
Error
gradle failed resolve `com.theartofdev.edmodo:android-image-cropper:+” Compilation fails.
build.gradle code
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.backuppc.breathanalyzer"
minSdkVersion 23
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
The dependencies
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.theartofdev.edmodo:android-image-cropper:+'
}
Please replace the
compile 'com.theartofdev.edmodo:android-image-cropper:+'
with the latest version
compile 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
Please make sure the dependency is of latest version. You can get the latest version here:
https://bintray.com/package/files/arthurhub/maven/Android-Image-Cropper?order=asc&sort=name&basePath=com%2Ftheartofdev%2Fedmodo%2Fandroid-image-cropper&tab=files
Hope this helps..
Android studio shows possible causes:
The project may be using a version of Gradle that does not contain the method.The build file may be missing a Gradle plugin.
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 17
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "com.android.application"
manifestPlaceholders = [manifestApplicationId: "${com.android.application}",
onesignal_app_id:"3z281386-18df-4ae8-95fb-da47db595f27",
onesignal_google_project_number:"570040958475"]
minSdkVersion 22
targetSdkVersion 22
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:22.2.1'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.android.gms:play-services-ads:8.1.0'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile 'com.onesignal:OneSignal:2.+#aar'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
compile 'com.google.android.gms:play-services-location:8.1.0' }
You need to add
apply plugin: 'com.android.application'
As the first line of the build.gradle
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
}
}
The problem I am facing is that my android application works well on devices 4.4.2 and below, but crashes on devices having Lollipop(5.0) and its corresponding higher versions.I know that its somehow related to the build tools in my gradle file,but still not able to figure out the problem.Could someone please help me out with this.
This is my gradle file,
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "com.vs.vertosys"
minSdkVersion 14
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter() {}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:multidex:1.0.1'
// compile 'com.android.support:appcompat-v4:23.1.1'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-location:+'
compile 'com.pushwoosh:pushwoosh:+'
}
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'