How to change target sdk and compile sdk into 25 - android

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
}
}

Related

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.

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

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.

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'

RenderScript does not build ScriptC file on android studio

I am trying to integrate the answer which uses render script in the following link to my project. But rotator.rs does not generate the ScriptC_rotator file. How can I integrate this?
Android: rotate image without loading it to memory
My Gradle (I can import android.support.v8.renderscript.RenderScript and
android.support.v8.renderscript.Allocation fine)
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.XXXX"
minSdkVersion 12
targetSdkVersion 23
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
renderscriptNdkModeEnabled true
}
buildTypes {
release {
minifyEnabled false
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:+'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:appcompat-v7:+'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
}
renderscriptNdkModeEnabled should be false. If you have it set to true, you will get ScriptC_rotator.cpp instead.

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