I have just finished working with my android project and decided to publish it on Google Play Store. When I uploaded the signed APK file in the production tab of Google Play Console, I faced the following issue:
Here is the gradle information:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.parma.torupee"
minSdkVersion 26
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:26.1.0'
compile 'com.jjoe64:graphview:4.2.1'
}
I have developed the application in Android Studio 3.0.1(did not update). I tried changing the targeted SDK to 29 but then I received errors for implementation 'com.android.support:appcompat-v7:26.1.0' and implementation 'com.android.support:design:26.1.0' lines in the gradle file.
How can I change the target SDK to 29 such that it supports the latest version and also support API level 26(Oreo)? Any help would be highly appreciated!
Compile SDK Version
The Compile SDK Version is the version of Android in which you write code. If you choose 9, you can write code with all the APIs in version 28.
Minimum SDK Version
Android operating system (OS) versions are backward-compatible. If your minSdkVersion is set to Android version 22, your application will run on Lolipop (5.1) and above .
Target SDK Version
You should set the targetSdkVersion to the most recent version of Android that you have tested on.
Whenever a new version of Android comes out, you will want to update the targetSdkVersion to the latest Android version and test your app to fix any problems. If you don’t google may force you to update it. This allows you to use the new security patches commonly applied for most of the OS versions.
Increasing your target sdk doesnt affect the minimum version number you have defined.
EDITED : Updated comment on support library
If you want to update your target SDK to 28 then it might be easier as you could use the below support libraries
com.android.support:support-compat:28.0.0 but if you plan to use target sdk as 29 then you have to migrate all your support packages to androidx libraries .
https://developer.android.com/topic/libraries/support-library/packages
For easier migration you could follow the stesp give here https://developer.android.com/jetpack/androidx/migrate
Let me know if this helps
You could use:
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.android.support:design:29.0.0'
Related
This question already has answers here:
Android Studio keeps refusing to resolve com.android.support:appcompat-v7:29.0.1
(6 answers)
Closed 3 years ago.
I'm at the newest level on Android. just boot up a new project and got error on the Gradle Build with Pie ( Android v9.0):
Unable to resolve dependency for
':app#debugAndroidTest/compileClasspath': Could not find any version
that matches com.android.support:appcompat-v7:29.+.
this is my build.gradle (Module:app):
apply plugin: 'com.android.library'
android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:29.+'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
How do I do next?
You are using support library which was last released for API 28 but you are trying to find API 29 version of this library. API 29 version of this library was moved to another library called AndroidX.
Goto Menu bar in Android Studio, Select Refactor then Migrate to AndroidX, that should solve the issue.
This will replace any old support library packages that you are using with newer AndroidX versions.
If you get any error in your dependencies after Migrating, find your dependency packages from the following lik and replace them with the newer ones listed in table:
https://developer.android.com/jetpack/androidx/migrate
Try migrating to Androidx
Android Studio > Refactor Menu > Migrate to AndroidX...
From docs:
With the release of Android 9.0 (API level 28) there is a new version
of the support library called AndroidX which is part of Jetpack. The
AndroidX library contains the existing support library and also
includes the latest Jetpack components.
You can continue to use the support library. Historical artifacts
(those versioned 27 and earlier, and packaged as android.support.*)
will remain available on Google Maven. However, all new library
development will occur in the AndroidX library.
We recommend using the AndroidX libraries in all new projects. You
should also consider migrating existing projects to AndroidX as well.
When I use com.android.support:appcompat-v7:28.+ in my project's build.gradle(module) it works without any error. But when I just use com.android.support:appcompat-v7:28, just without .+, it gives me an error:
Failed to resolve: com.android.support:appcompat-v7:28.0
Just without the .+ end of it. I added maven before but the result was the same. Any idea to solve it?
28.0.0 is the final version of support libraries. Android has migrated to AndroidX. To use the latest android libraries, Migrating to AndroidX
Edit: Versions 28.0.0-rc02 and 28.0.0 are now available.
I don't see any 28.0 version on Google Maven. Only 28.0.0-alpha1 and 28.0.0-alpha3. Just change it to either of those or how it was previously, i.e., with .+ which just means any version under 28 major release.
For an alpha appcompat release 28.+ makes more sense.
Add the following code on build.gragle (project) for adding Google maven repository
allprojects {
repositories {
...
maven {
url 'https://maven.google.com/'
name 'Google'
}
...
}
}
some guys who still might have the problem like me (FOR IRANIAN and all the coutries who have sanctions) , this is error can be fixed with proxy
i used this free proxy for android studio 3.2
https://github.com/freedomofdevelopers/fod
just to to Settings (Ctrl + Alt + S) and search HTTP proxy then check Manual proxy configuration then add fodev.org
for host name and 8118 for Port number
As #Sourabh already pointed out, you can check in the Google Maven link what are the packages that Google has listed out.
If you, like me, are prompted with a similar message to this Failed to resolve: com.android.support:appcompat-v7:28.0, it could be that you got there after upgrading the targetSdkVersion or compileSdkVersion.
What is basically happening is that the package is not being found, as the message correctly says. If you upgraded the SDK, check the Google Maven, to check what are the available versions of the package for the new SDK version that you want to upgrade to.
I had these dependencies (on version 27):
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
And I had to change the SDK version and the rest of the package number:
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
Now the packages are found and downloaded. Since the only available package for the 28 version of the SDK is 28.0.0 at the moment of writing this.
Run
gradlew -q app:dependencies
It will remove what is wrong.
my problem was just network connection. using VPN solved the issue.
implementation 'com.android.support:appcompat-v7:28.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
All to add
Ensure that your buildToolsVersion version tallies with your app compact version.
In order to find both installed compileSdkVersion and buildToolsVersion go to Tools > SDK Manager. This will pull up a window that will allow you to manage your compileSdkVersion and your buildToolsVersion.
To see the exact version breakdowns ensure you have the Show Package Details checkbox checked.
android {
compileSdkVersion 28
buildToolsVersion "28.0.3" (HERE)
defaultConfig {
applicationId "com.example.truecitizenquiz"
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0' (HERE)
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
in build.gradle , the version of bellow line should be same
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:design:28.0.0'
Android beginner here...
I'm getting all sort of rendering errors, and eventually concluded it's got something to do with my gradle dependencies.
Now I found a nice tutorial which I've been following, http://www.android4devs.com/2015/06/navigation-view-material-design-support.html but I'm running to a problem extending it further, and there is something I don't think I understand.
Should I not be using the latest stable version of any library I can? Surely these libraries are backwards compatible?
If I am supposed to use the older version of library, to match the compile sdk (which I understand to mean I'm compiling for backwards compatibility, and supporting, say, lollipop API 21-22) then:
I would need a place to see a complete list of all versions of all libraries (which I cannot find), and
I would not be able to use new features like RecyclerView which only came in at Marshmallow API 23.
Am I missing something?
build.gradle (module app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.example.myFirstApp"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
...
...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.intuit.sdp:sdp-android:1.0.3'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
Error message
The support library should not use a different version (26) than the compile sdk version (22).
You are using
compileSdkVersion 22
and
compile 'com.android.support:appcompat-v7:26.1.0'
error you are getting is because you are using compat version 26 while compileSdkversion is 22
You should update to compileSdkVersion to 26 and android studio will download required files so that your error will be removed. If you cannot update your compilesdk version to 26. Then change support library version to 22.2.1
compile 'com.android.support:appcompat-v7:22.2.1'
Got list of support libraries from link
https://developer.android.com/topic/libraries/support-library/rev-archive.html
and
https://developer.android.com/topic/libraries/support-library/revisions.html
I develop an Android app using Android Studio and I got the message today that there is a new version of Google Play services and Firebase.
From 10.0.1 to 10.2.0.
I'm using Google play services analytics and ads that's all.
I am already choose an API min 9 and Now I think the ads can't be show in API < 14 .
My build.gradle File:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.ilyo.x1application"
minSdkVersion 9
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'])
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:25.1.1'
compile 'com.google.firebase:firebase-ads:10.2.0'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.android.gms:play-services-ads:10.2.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Error Message
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 14 declared in library
[com.google.firebase:firebase-ads:10.2.0]
/Users/mac/Documents/AndroidStudioProjects/Project1/app/build/intermediates/exploded-aar/com.google.firebase/firebase-ads/10.2.0/AndroidManifest.xml
Suggestion: use
tools:overrideLibrary="com.google.firebase.firebase_ads" to force
usage
I want to all my ads of my Application can show in all devices, What do you recommend ?
The 10.2.0 version of ALL google related services require a minimum of API version 14. This is a choice done by Google, so they don't have to support API versions below 14.
So you'll have to stick to version 10.0.1 forever if you want to support API versions below 14. Or, you will have to raise your apps minimum API version to 14, and then use the new google services.
Article: https://www.xda-developers.com/google-play-services-release-notes-are-available-for-the-10-2-update-bye-gingerbread/
Here you can find the official blog post by Google.
Version 10.0.0 of the Google Play services client libraries, as well as the Firebase client libraries for Android, will be the last version of these libraries that support Android API level 9 (Android 2.3, Gingerbread). The next scheduled release of these libraries, version 10.2.0, will increase the minimum supported API level from 9 to 14.
Since you are using:
minSdkVersion 9
you have to change it with:
minSdkVersion 14
Otherwise you can build multiple APKs to support devices with an API level less than 14 using:
productFlavors {
legacy {
minSdkVersion 9
}
current {
minSdkVersion 14
}
}
dependencies {
legacyCompile 'com.google.android.gms:play-services:10.0.0'
currentCompile 'com.google.android.gms:play-services:10.2.0'
}
Today, Google released SDK 6 API 23+.
I tried to create a project with the API 23, but I'm having the following problem:
Failed to resolve: com.android.support:appcompat-v7:23.0
Here's my gradle file:
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "my.package"
minSdkVersion 17
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'])
wearApp project(':wear')
compile 'com.android.support:appcompat-v7:23.0'
compile 'com.google.android.gms:play-services:7.8.0'
}
In the SDK manager, the version 23 isn't listed to update:
How can I solve this?
Original answer:
I too tried to change the support library to "23". When I changed the targetSdkVersion to 23, Android Studio reported the following error:
This support library should not use a lower version (22) than the targetSdkVersion (23)
I simply changed:
compile 'com.android.support:appcompat-v7:23.0.0'
to
compile 'com.android.support:appcompat-v7:+'
Although this fixed my issue, you should not use dynamic versions. After a few hours the new support repository was available and it is currently 23.0.1.
Pro tip:
You can use double quotes and create a ${supportLibVersion} variable for simplicity. Example:
ext {
supportLibVersion = '23.1.1'
}
compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile "com.android.support:design:${supportLibVersion}"
compile "com.android.support:palette-v7:${supportLibVersion}"
compile "com.android.support:customtabs:${supportLibVersion}"
compile "com.android.support:gridlayout-v7:${supportLibVersion}"
source: https://twitter.com/manidesto/status/669195097947377664
As seen in the revision column of the Android SDK Manager, the latest published version of the Support Library is 22.2.1. You'll have to wait until 23.0.0 is published.
Edit: API 23 is already published. So u can use 23.0.0
Ran into a similar issue using React Native
> Could not find com.android.support:appcompat-v7:23.0.1.
the Support Libraries are Local Maven repository for Support Libraries
First you need to download the latest support repository (17 by the time I write this) from internal SDK manager of Android Studio or from the stand alone SDK manager. Then you can add compile 'com.android.support:appcompat-v7:23.0.0' or any other support library you want to your build.gradle file. (Don't forget the last .0)
Latest published version of the Support Library is 24.1.1, So you can use it like this,
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
Same as for other support components.
You can see the revisions here,
https://developer.android.com/topic/libraries/support-library/revisions.html